Esempio n. 1
0
        public async Task Can_Not_Get_Configuration_If_None_Exists()
        {
            //Arrange
            var orgId        = int.MaxValue;
            var overviewType = A <OverviewType>();

            //Act
            using var response = await KendoOverviewConfigurationHelper.SendGetConfigurationRequestAsync(orgId, overviewType);

            //Assert
            Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
        }
Esempio n. 2
0
        public async Task Can_Get_Configuration()
        {
            //Arrange
            var overviewType = A <OverviewType>();
            var config       = A <string>();

            var saveResponse = await KendoOverviewConfigurationHelper.SendSaveConfigurationRequestAsync(TestEnvironment.DefaultOrganizationId, overviewType, config);

            Assert.Equal(HttpStatusCode.OK, saveResponse.StatusCode);

            //Act
            using var response = await KendoOverviewConfigurationHelper.SendGetConfigurationRequestAsync(TestEnvironment.DefaultOrganizationId, overviewType);

            //Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            var kendoConfig = await response.ReadResponseBodyAsKitosApiResponseAsync <KendoOrganizationalConfigurationDTO>();

            Assert.Equal(TestEnvironment.DefaultOrganizationId, kendoConfig.OrganizationId);
            Assert.Equal(overviewType, kendoConfig.OverviewType);
            Assert.Equal(config, kendoConfig.Configuration);
        }