demo-xf-app-1a/MobileApp1/Services/CorporationMockService.cs
2022-09-30 18:06:31 +01:00

69 lines
1.6 KiB
C#

using System;
namespace MobileApp1.Services
{
public class CorporationMockService : ICorporationService
{
private Random randy = null;
public CorporationMockService()
{
randy = new Random();
}
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);
//this.DisplayName = username;
this.DisplayName = "John";
this.IsLoggedIn = true;
return ServiceResult.Create(true, "Logged In");
}
public ServiceResult Logout()
{
System.Threading.Thread.Sleep(1000);
this.DisplayName = string.Empty;
this.IsLoggedIn = false;
return ServiceResult.Create(true, "Logged Out");
}
public ServiceResult RequestPasswordReset(string username)
{
System.Threading.Thread.Sleep(1000);
this.DisplayName = string.Empty;
this.IsLoggedIn = false;
return ServiceResult.Create(true, "Password Reset Requested");
}
public WelcomePackResult RetrieveWelcomePack()
{
System.Threading.Thread.Sleep(1000);
return new WelcomePackResult()
{
IsSuccess = true,
Message = "",
MessagesCount = randy.Next(0, 25),
NoticesCount = randy.Next(0, 10)
};
}
}
}