demo-xf-app-1a/MobileApp1/Services/CorporationMockService.cs

69 lines
1.6 KiB
C#
Raw Normal View History

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()
{
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)
{
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
};
}
}
}