Writing test cases in Xamarin Forms

DeveshMishraDeveshMishra USMember ✭✭

Hi,

I am very new to writing unit & end to end test cases for XF mobile application. I am not able to find a proper documentation on writing test cases for XF applications.

There is one document at Xamarin official page which is not from zero.

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/enterprise-application-patterns/unit-testing

Can someone tell me any resources where i can find a start from zero ?

It will be a great help indeed.

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Huh... I never thought about it... But I don't know how those cases depend on the system used to make the app. Does it matter that its a Xamarin.Forms app? Aren't most test cases about doing a given job? Press button [SAVE] and the app should save. That sort of thing?

    I just wonder if you're looking too tightly. Kind of like searching "Safety test cases for a 2015 Volkswagen Rabbit" - When the safety requirements are independent of vehicle and are the same for VW, Honda, and Toyota.

  • DeveshMishraDeveshMishra USMember ✭✭

    @ClintStLaurent said:
    Huh... I never thought about it... But I don't know how those cases depend on the system used to make the app. Does it matter that its a Xamarin.Forms app? Aren't most test cases about doing a given job? Press button [SAVE] and the app should save. That sort of thing?

    I just wonder if you're looking too tightly. Kind of like searching "Safety test cases for a 2015 Volkswagen Rabbit" - When the safety requirements are independent of vehicle and are the same for VW, Honda, and Toyota.

    Agreed with your point. Well in that case, please suggest me what kind of search i should go for which can solve my purpose.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭
    edited July 2018
  • JohnHardmanJohnHardman GBUniversity mod

    @DeveshMishra said:
    Hi,

    I am very new to writing unit & end to end test cases for XF mobile application. I am not able to find a proper documentation on writing test cases for XF applications.

    There is one document at Xamarin official page which is not from zero.

    https://docs.microsoft.com/en-us/xamarin/xamarin-forms/enterprise-application-patterns/unit-testing

    Can someone tell me any resources where i can find a start from zero ?

    It will be a great help indeed.

    The book "The art of Unit Testing with examples in C#" by Roy Osherove is a good starter. Use that in conjunction with the MVVM-related stuff at https://docs.microsoft.com/en-us/xamarin/xamarin-forms/enterprise-application-patterns/unit-testing. If you're being really methodical you will test the model and view model separately, using mocking as required, then test the model and view model together as as what us old-school types call an integration test. End-to-end testing will require Xamarin UITest or similar, although the last time I used it it still did not support UWP apps - I assume that hasn't changed, but you might want to check.

Sign In or Register to comment.