![]() From the right-click menu, choose Rename (or press F2), and then rename the file to BankAccountTests.cs. To rename the file, in Solution Explorer, select the UnitTest1.cs file in the BankTests project.You can use the UnitTest1.cs file that was generated by the project template, but give the file and class more descriptive names. ![]() In the Reference Manager dialog box, expand Projects, select Solution, and then check the Bank item.Ĭreate a test class to verify the BankAccount class. In Solution Explorer, select Dependencies under the BankTests project and then choose Add Reference (or Add Project Reference) from the right-click menu. In the BankTests project, add a reference to the Bank project. The BankTests project is added to the Bank solution. Name the project BankTests and click Next.Ĭhoose either the recommended target framework or. In Visual Studio 2019 version 16.9, the MSTest project template is Unit Test Project. ![]() Throw new ArgumentOutOfRangeException("amount") Public BankAccount(string customerName, double balance) Replace the contents of Program.cs with the following C# code that defines a class, BankAccount: using System If Program.cs is not open in the editor, double-click the file Program.cs in Solution Explorer to open it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |