Exemplo n.º 1
0
        public void ReportAccessorAPI_GetWithValidConnectionDetails_Success()
        {
            // arrange
            AbacusSettingModel abacusSetting = new AbacusSettingModel(
                TEST_AbacusSetting_Name,
                TEST_AbacusSetting_Description,
                USE_TestSever ? TEST_Testserver_AbacusSetting_ServiceServerName : TEST_AbacusSetting_ServiceServerName,
                USE_TestSever ? TEST_Testserver_AbacusSetting_ServicePort : TEST_AbacusSetting_ServicePort,
                USE_TestSever ? TEST_Testserver_AbacusSetting_UseSsl : TEST_AbacusSetting_UseSsl,
                TEST_AbacusSetting_ServiceUser,
                TEST_AbacusSetting_ServicePasswordCrypted);

            TenantModel tenant = new TenantModel(
                TEST_Tenant_Name,
                TEST_Tenant_Description,
                TEST_Tenant_Number,
                abacusSetting);

            // act
            DateTime start  = DateTime.Now;
            var      result = WrapperAPI.GetRequest("/api/reportaccessor", tenant);
            DateTime stop   = DateTime.Now;
            var      data   = result.ToContentObject <List <_ACAG_AbacusCalendarConnector> >();

            // assert
            Assert.IsTrue(result.IsSuccessStatusCode);
            Assert.IsNotNull(data);
            Assert.IsTrue(data.Count > 0);
            System.Diagnostics.Debug.WriteLine($"Duration: {stop.Subtract(start)}");
            System.Diagnostics.Debug.WriteLine($"Count: {data.Count}");
        }
Exemplo n.º 2
0
        public void ReportAccessorAPI_GetWithTenantNumberInvalid_Fail()
        {
            // arrange
            AbacusSettingModel abacusSetting = new AbacusSettingModel(
                TEST_AbacusSetting_Name,
                TEST_AbacusSetting_Description,
                USE_TestSever ? TEST_Testserver_AbacusSetting_ServiceServerName : TEST_AbacusSetting_ServiceServerName,
                USE_TestSever ? TEST_Testserver_AbacusSetting_ServicePort : TEST_AbacusSetting_ServicePort,
                USE_TestSever ? TEST_Testserver_AbacusSetting_UseSsl : TEST_AbacusSetting_UseSsl,
                TEST_AbacusSetting_ServiceUser,
                TEST_AbacusSetting_ServicePasswordCrypted);

            TenantModel tenant = new TenantModel(
                TEST_Tenant_Name,
                TEST_Tenant_Description,
                666,
                abacusSetting);

            // act
            var result = WrapperAPI.GetRequest("/api/reportaccessor", tenant);
            var data   = result.ToContentObject <List <_ACAG_AbacusCalendarConnector> >();

            // assert
            Assert.IsFalse(result.IsSuccessStatusCode);
            Assert.IsNull(data);
        }
Exemplo n.º 3
0
        public void TestConnectionAPI_GetWithAbacusSettingDescriptionEmpty_Success()
        {
            // arrange
            AbacusSettingModel abacusSetting = new AbacusSettingModel(
                TEST_AbacusSetting_Name,
                string.Empty,
                USE_TestSever ? TEST_Testserver_AbacusSetting_ServiceServerName : TEST_AbacusSetting_ServiceServerName,
                USE_TestSever ? TEST_Testserver_AbacusSetting_ServicePort : TEST_AbacusSetting_ServicePort,
                USE_TestSever ? TEST_Testserver_AbacusSetting_UseSsl : TEST_AbacusSetting_UseSsl,
                TEST_AbacusSetting_ServiceUser,
                TEST_AbacusSetting_ServicePasswordCrypted);

            TenantModel tenant = new TenantModel(
                TEST_Tenant_Name,
                TEST_Tenant_Description,
                TEST_Tenant_Number,
                abacusSetting);

            // act
            var result = WrapperAPI.GetRequest("/api/reportaccessor", tenant);
            var data   = result.ToContentObject <List <_ACAG_AbacusCalendarConnector> >();

            // assert
            Assert.IsTrue(result.IsSuccessStatusCode);
            Assert.IsNotNull(data);
            Assert.IsTrue(data.Count > 0);
        }