C # Best Practices,

Source: Internet
Author: User

C # Best Practices,
Application Architecture

Define the components appropriately for the application and create project for each one.

 

What is Class?

3 Things: Visual Things, Business Things (Domain Entities), Application Things (like Logging & Email Generation)

3 Types: User interface classes, Domain entity classes, Library class

Class is a template or mold, specifies the traits or data, specifies the behavior or operations.

Unit Testing

3 Advantages:

Higher Code Quality, Faster and Easier Debugging, Repeatable

Features:

Tests the behavior of a unit of code (often a method), automatic, Defined with code, Identifies errors

Tools:

MSTest, NUnit

Steps:

1. Define the test scenarios, 2. Generate the tests, 3. Execute the tests

Arrange-> Act-> Assert

FAQ

1. Why is a layer architecture important?

Logical components are easier to create, change, extend and maintain

Code are easier to reuse

2. What is a class?

A template for the objects created at runtime

Specifies the data and operations for each entity

3. What are the benefits of unit testing?

Higher quality code, faster and easier debugging, and they are repeatable over the life of the application

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.