Book Image

Learning Xamarin studio

By : William Smith
Book Image

Learning Xamarin studio

By: William Smith

Overview of this book

Table of Contents (16 chapters)
Learning Xamarin Studio
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a unit test project


To begin, you need to create your unit test project. To create the project, follow these steps:

  1. Navigate to iOS | iPhone and create a new Empty Project solution.

  2. Name this project UnitTestsLibrary.

  3. Change the name of the solution to UnitTestsSolution and click the OK button.

  4. Right-click the solution and add a new project.

  5. From the new object dialog, open the iOS group.

  6. Select the iOS Unit Tests Project template.

  7. Name the project UnitTests and click the OK button.

  8. Right-click the UnitTestsLibrary project and add a new file.

  9. From the General group, add a new Empty Class to the project.

  10. Name the file MethodsForTesting.

  11. From the same project, delete the MyClass.cs file.

  12. In the UnitTests project, right-click on the References folder and choose Edit References.

  13. In the Projects tab, check the UnitTestsLibrary project and click the OK button.

  14. From the UnitTestLibrary project, open the MethodsForTesting.cs file and add the following code below the constructor:

    public int AddValues(int...