Skip to content

Instantly share code, notes, and snippets.

Avatar

PulkitSethi1984

View GitHub Profile
View ItemListTest.cs
[TestFixture(Platform.Android)]
[TestFixture(Platform.iOS)]
public class ItemListTest : BaseTest
{
public ItemListTest(Platform platform) : base(platform)
{ }
[Test]
public void ItemListBasicTest()
{
View MainApplication.cs
#if AUTOMATION
[Export("LoadApiData")]
public void LoadApiData(string jsonData)
{
var rp = AppContainer.Instance.Resolve<INetworkService>() as MockNetworkService;
rp.LoadApiData(jsonData);
}
[Export("ReloadApiData")]
View AppServices.cs
public void RegisterServices()
{
var builder = new ContainerBuilder();
#if AUTOMATION
builder.RegisterType<MockNetworkService>.As<INetworkService>().SingleInstance();
#else
builder.RegisterInstance<NetworkService>.As<INetworkService>().SingleInstance();
#endif
View MockNetworkService.CS
public enum ServiceMode
{
RECORD,
MOCK
}
public class Request
{
public string Uri { get; set; }
public string RelativeUri { get; set; }
View INetworkService.cs
public interface INetworkService
{
Task<NetResult<TResult>> GetAsync<TResult>(string uri, string token = "");
Task<NetResult<TResult>> PostAsync<TResult>(string uri, TResult data, string token = "", string header = "");
Task<NetResult<TResult>> PostAsync<TResult>(string uri, string data, string clientId, string clientSecret);
Task<NetResult<TResult>> PutAsync<TResult>(string uri, TResult data, string token = "", string header = "");
View LoginViewController.cs
public partial class LoginViewController : UIViewController
{
private ILoginPresenter _loginPresenter = null;
private IAsyncSubscriber _listenerToken = null;
public override void ViewDidLoad()
{
base.ViewDidLoad();
View ILoginView.cs
public interface ILoginView
{
void SetLoadingState();
void SetDelayedState();
void ClearFields();
void ShowFingerPrint();
void ShowPasscode();
void ShowLogin();
}
View AppDelegate.cs
[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
private void LoadDependencies()
{
// Load dependencies in methods that run once per run of the application
IDependencyService serviceLocator = DependencyService.Instance;
if (null == serviceLocator.GetService<ILoginPresenter)
You can’t perform that action at this time.