Created
December 15, 2016 02:31
-
-
Save jonathanpeppers/5a982fe96512e6501890aef9f6a2a388 to your computer and use it in GitHub Desktop.
FakeWebService for Packt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FakeWebService : IWebService | |
{ | |
public int SleepDuration { get; set; } | |
public FakeWebService() | |
{ | |
SleepDuration = 1000; | |
} | |
private Task Sleep() | |
{ | |
return Task.Delay(SleepDuration); | |
} | |
public async Task<User> Login(string userName, string password) | |
{ | |
await Sleep(); | |
return new User { Name = userName }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment