Skip to content

Instantly share code, notes, and snippets.

View PulkitSethi1984's full-sized avatar

PulkitSethi1984

View GitHub Profile
[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)
public interface ILoginView
{
void SetLoadingState();
void SetDelayedState();
void ClearFields();
void ShowFingerPrint();
void ShowPasscode();
void ShowLogin();
}
public partial class LoginViewController : UIViewController
{
private ILoginPresenter _loginPresenter = null;
private IAsyncSubscriber _listenerToken = null;
public override void ViewDidLoad()
{
base.ViewDidLoad();
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 = "");
public enum ServiceMode
{
RECORD,
MOCK
}
public class Request
{
public string Uri { get; set; }
public string RelativeUri { get; set; }
public void RegisterServices()
{
var builder = new ContainerBuilder();
#if AUTOMATION
builder.RegisterType<MockNetworkService>.As<INetworkService>().SingleInstance();
#else
builder.RegisterInstance<NetworkService>.As<INetworkService>().SingleInstance();
#endif
#if AUTOMATION
[Export("LoadApiData")]
public void LoadApiData(string jsonData)
{
var rp = AppContainer.Instance.Resolve<INetworkService>() as MockNetworkService;
rp.LoadApiData(jsonData);
}
[Export("ReloadApiData")]
[TestFixture(Platform.Android)]
[TestFixture(Platform.iOS)]
public class ItemListTest : BaseTest
{
public ItemListTest(Platform platform) : base(platform)
{ }
[Test]
public void ItemListBasicTest()
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace App.Common.Core.ViewModels
using System;
using System.Threading.Tasks;
namespace App.Common.Core.Services.App
{
public interface INavigationService
{
Task NavigateToAsync<TViewModel>(object parameter);
}
}