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_Not_Save_Configuration_If_Not_Allowed(OrganizationRole orgRole)
        {
            //Arrange
            var overviewType = A <OverviewType>();
            var config       = A <string>();
            var cookie       = await HttpApi.GetCookieAsync(orgRole);

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

            //Assert
            Assert.Equal(HttpStatusCode.Forbidden, response.StatusCode);
        }
Esempio n. 3
0
        public async Task Can_Delete_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.SendDeleteConfigurationRequestAsync(TestEnvironment.DefaultOrganizationId, overviewType);

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

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

            //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);
        }