コード例 #1
0
        public ModSicServiceProxyTests()
        {
            var mocks = new MockRepository();
            this.FakeCollectService = mocks.DynamicMock<ICollectService>();
            mocks.ReplayAll();

            this.ModSicProxy = new ModSicServiceProxy(FAKE_MODSIC_URL, FakeCollectService);
        }
コード例 #2
0
ファイル: ModSicConnection.cs プロジェクト: ywcsz/modSIC
 /// <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;
 }
コード例 #3
0
ファイル: ModSicConnection.cs プロジェクト: jonaslsl/modSIC
 /// <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);
 }
コード例 #4
0
ファイル: ModSicApiTest.cs プロジェクト: jonaslsl/modSIC
 private void ModSicLogoutMustBeCalling(ModSicServiceProxy fakeModSicProxy)
 {
     fakeModSicProxy.AssertWasCalled<ModSicServiceProxy>(p => p.Logout(FakeLoginInfoToReturn.Token));
 }
コード例 #5
0
ファイル: ModSicApiTest.cs プロジェクト: jonaslsl/modSIC
 private void ModSicLoginMustBeCalling(ModSicServiceProxy fakeModSicProxy)
 {
     fakeModSicProxy
         .AssertWasCalled<ModSicServiceProxy>(
             p => p.LoginEx(FAKE_MODSIC_USERNAME, FAKE_MODSIC_PASSWORD, FAKE_MODSIC_CLIENTID, FakeApiVersion));
 }
コード例 #6
0
ファイル: ModSicApiTest.cs プロジェクト: jonaslsl/modSIC
 private ModSicConnection CreateModSicAPI(ModSicServiceProxy modSicProxy)
 {
     return new ModSicConnection(modSicProxy, FAKE_MODSIC_USERNAME, FAKE_MODSIC_PASSWORD, FAKE_MODSIC_CLIENTID, this.FakeApiVersion);
 }