public void SetUp() { server = FluentMockServer.Start(); localUrl = server.Urls[0]; ServiceFinder.RegisterInstance <IPlatformBridge>(new DummyPlatformBridge()); server.Given(Request.Create().WithPath(GET_TEST_PATH).UsingGet()).RespondWith(Response.Create().WithStatusCode(200).WithHeader("Content-Type", "application/json").WithBody(GET_TEST_BODY)); }
private static void initializePlatformServices(Context appContext) { if (!ServiceFinder.IsRegistered <IPlatformBridge>()) { ServiceFinder.RegisterInstance <IPlatformBridge>(new AndroidPlatformBridge(appContext)); } }
private static void initializePlatformServices() { if (!ServiceFinder.IsRegistered <IPlatformBridge>()) { ServiceFinder.RegisterInstance <IPlatformBridge>(new IOSPlatformBridge()); } }
/// <summary> /// Initializes a new instance of the <see cref="T:AeroGear.Mobile.Security.DeviceChecks"/> class. /// Private so that it can't be instantiated externally: useful to emulate an enum. /// </summary> /// <param name="checkType">The class type of the check represented by this instance.</param> private DeviceChecks(Type checkType, string friendlyName = null) { if (!ServiceFinder.IsRegistered <IDeviceCheckFactory>()) { ServiceFinder.RegisterInstance <IDeviceCheckFactory>(IOSDeviceCheckFactory.INSTANCE); } this.CheckType = checkType; typesByName[friendlyName ?? checkType.Name] = this; }
private static void RegisterServices() { ServiceFinder.RegisterType <IOAuthClientHandlerService, OAuthClientHandlerService> (); ServiceFinder.RegisterType <IDataService, DataService> (); ServiceFinder.RegisterType <IIOService, IOService> (); ServiceFinder.RegisterType <IDeviceService, DeviceService> (); ServiceFinder.RegisterType <IHashService, HashService> (); ServiceFinder.RegisterType <ILogService, LogService> (); ServiceFinder.RegisterType <IMonitorService, MonitorService> (); ServiceFinder.RegisterType <INetworkService, NetworkService> (); ServiceFinder.RegisterInstance <IPush> (new Push()); }
public void SetUp() { mockSecurityCheckType = new Mock <IDeviceCheckType>().Object; var mock = new Mock <IDeviceCheck>(); mockSecurityCheck = mock.Object; mock.Setup(mockSecurityCheck => mockSecurityCheck.GetId()).Returns("test-id"); mock.Setup(mockSecurityCheck => mockSecurityCheck.GetName()).Returns("test-name"); DeviceCheckResult result = new DeviceCheckResult(mockSecurityCheck, true); mock.Setup(mockSecurityCheck => mockSecurityCheck.Check()).Returns(result); var mockSecurityCheckFactory = new Mock <IDeviceCheckFactory>(); this.mockCheckFactory = mockSecurityCheckFactory.Object; mockSecurityCheckFactory.Setup(mockCheckFactory => mockCheckFactory.create(mockSecurityCheckType)).Returns(mockSecurityCheck); ServiceFinder.RegisterInstance <IDeviceCheckFactory>(mockCheckFactory); }
public AbstractSecurityService(IDeviceCheckFactory checkFactory) { ServiceFinder.RegisterInstance <IDeviceCheckFactory>(checkFactory); }
public SecurityService() { ServiceFinder.RegisterInstance <ISecurityCheckFactory>(new IOSSecurityCheckFactory()); }
public SecurityService() { ServiceFinder.RegisterInstance <ISecurityCheckFactory>(new AndroidSecurityCheckFactory(Android.App.Application.Context)); }