2022-09-30 17:06:31 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace MobileApp1.Services
|
2021-07-13 13:57:44 +00:00
|
|
|
|
{
|
|
|
|
|
public class CorporationMockService : ICorporationService
|
|
|
|
|
{
|
2022-09-30 17:06:31 +00:00
|
|
|
|
private Random randy = null;
|
|
|
|
|
|
|
|
|
|
|
2021-07-13 13:57:44 +00:00
|
|
|
|
public CorporationMockService()
|
|
|
|
|
{
|
2022-09-30 17:06:31 +00:00
|
|
|
|
randy = new Random();
|
2021-07-13 13:57:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public string DisplayName { get; set; } = "";
|
|
|
|
|
|
|
|
|
|
public bool IsLoggedIn { get; set; } = false;
|
|
|
|
|
|
|
|
|
|
public string AuthToken { get; set; } = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ServiceResult Login(string username, string password)
|
|
|
|
|
{
|
|
|
|
|
System.Threading.Thread.Sleep(6000);
|
|
|
|
|
|
2022-09-30 17:06:31 +00:00
|
|
|
|
//this.DisplayName = username;
|
|
|
|
|
this.DisplayName = "John";
|
2021-07-13 13:57:44 +00:00
|
|
|
|
this.IsLoggedIn = true;
|
|
|
|
|
|
2022-09-30 17:06:31 +00:00
|
|
|
|
return ServiceResult.Create(true, "Logged In");
|
2021-07-13 13:57:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ServiceResult Logout()
|
|
|
|
|
{
|
2021-08-06 13:15:24 +00:00
|
|
|
|
System.Threading.Thread.Sleep(1000);
|
2021-07-13 13:57:44 +00:00
|
|
|
|
|
|
|
|
|
this.DisplayName = string.Empty;
|
|
|
|
|
this.IsLoggedIn = false;
|
|
|
|
|
|
2022-09-30 17:06:31 +00:00
|
|
|
|
return ServiceResult.Create(true, "Logged Out");
|
2021-07-13 13:57:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ServiceResult RequestPasswordReset(string username)
|
|
|
|
|
{
|
2021-08-06 13:15:24 +00:00
|
|
|
|
System.Threading.Thread.Sleep(1000);
|
2021-07-13 13:57:44 +00:00
|
|
|
|
|
|
|
|
|
this.DisplayName = string.Empty;
|
|
|
|
|
this.IsLoggedIn = false;
|
|
|
|
|
|
2022-09-30 17:06:31 +00:00
|
|
|
|
return ServiceResult.Create(true, "Password Reset Requested");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public WelcomePackResult RetrieveWelcomePack()
|
|
|
|
|
{
|
|
|
|
|
System.Threading.Thread.Sleep(1000);
|
|
|
|
|
|
|
|
|
|
return new WelcomePackResult()
|
2021-07-13 13:57:44 +00:00
|
|
|
|
{
|
|
|
|
|
IsSuccess = true,
|
2022-09-30 17:06:31 +00:00
|
|
|
|
Message = "",
|
|
|
|
|
MessagesCount = randy.Next(0, 25),
|
|
|
|
|
NoticesCount = randy.Next(0, 10)
|
2021-07-13 13:57:44 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|