Check Mobile App
Read now

Unit Testing in iOS using swift (Part 3)

Save

Network Call check using Almofire.

In the previous blog, we have covered how to test the URL response is Valid or not using URLSession,

In this blog, we will cover through Almofire.

Previous Blog Link:

Unit Testing in iOS using swift (Part 2)

 

In This Blog we are not discussing about the expectaion for handling the Async call, this is already covered in the previous blog.

There are some steps that we need to follow.

1: Set Up Network Class.

First,we need to write the common class for network call.

Here we have written the network class where it will accept the

 

1: Api Name. : it the name which appends with your hostName.

2: Request Type 

3: Params

3: hostName: is baseURL like http://www.google.com

2: Open Your Test Class.

First,declare all the variable in the class.

3: Set up your test Class.

4 : Apply the Network Call.

5: Complete Class code :

 

If You Need Any Kind Of Help Regarding Unit testing Lets Comment To Us .

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

css.php

Today I am sure that I chose the right company, the app is very good and the service is very good, distance is not a problem. They always kept in touch by sending information. The staff is very competent, efficient. Mobikul for me is being the ideal partner to develop my app. I recommend.

Cristiano

Cristiano

Talk to Sales

Global

Live Chat
Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home