public ModSicServiceProxyTests() { var mocks = new MockRepository(); this.FakeCollectService = mocks.DynamicMock<ICollectService>(); mocks.ReplayAll(); this.ModSicProxy = new ModSicServiceProxy(FAKE_MODSIC_URL, FakeCollectService); }
/// <summary> /// This constructor must be use only for unit tests purposes. /// </summary> /// <param name="modSicProxy">An instance of ModSicServiceProxy with mock behavior.</param> /// <param name="username">modSIC user name. It´s optional, because you do not need to pass username in order to call Heartbeat operation.</param> /// <param name="username">modSIC password. Like username parameter.</param> public ModSicConnection(ModSicServiceProxy modSicProxyMock, string username = null, string password = null, string clientId = null, APIVersion apiVersion = null, string fakeCertificatePassword = "******") { this.Username = username; this.Password = password; this.ClientId = clientId; this.RequiredVersion = apiVersion; this.ModSicProxyService = modSicProxyMock; this.CertificatePassword = fakeCertificatePassword; }
/// <summary> /// Constructor for modSIC API. This is the constructor that be used in production code. /// </summary> /// <param name="username">modSIC user name. It´s optional, because you do not need to pass username in order to call Heartbeat operation.</param> /// <param name="username">modSIC password. Like username parameter.</param> public ModSicConnection(string modSicServiceURL, string username = null, string password = null, string clientId = null) { this.Username = username; this.Password = password; this.ClientId = clientId; this.RequiredVersion = new APIVersion(APIVersion.CURRENT_VERSION); this.ModSicProxyService = new ModSicServiceProxy(modSicServiceURL); }
private void ModSicLogoutMustBeCalling(ModSicServiceProxy fakeModSicProxy) { fakeModSicProxy.AssertWasCalled<ModSicServiceProxy>(p => p.Logout(FakeLoginInfoToReturn.Token)); }
private void ModSicLoginMustBeCalling(ModSicServiceProxy fakeModSicProxy) { fakeModSicProxy .AssertWasCalled<ModSicServiceProxy>( p => p.LoginEx(FAKE_MODSIC_USERNAME, FAKE_MODSIC_PASSWORD, FAKE_MODSIC_CLIENTID, FakeApiVersion)); }
private ModSicConnection CreateModSicAPI(ModSicServiceProxy modSicProxy) { return new ModSicConnection(modSicProxy, FAKE_MODSIC_USERNAME, FAKE_MODSIC_PASSWORD, FAKE_MODSIC_CLIENTID, this.FakeApiVersion); }