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

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

            //Assert
            Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
        }
Esempio n. 2
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. 3
0
        public async Task Can_Not_Delete_Configuration_If_Not_Allowed(OrganizationRole orgRole)
        {
            //Arrange
            var overviewType = A <OverviewType>();
            var config       = A <string>();
            var saveResponse = await KendoOverviewConfigurationHelper.SendSaveConfigurationRequestAsync(TestEnvironment.DefaultOrganizationId, overviewType, config);

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

            var cookie = await HttpApi.GetCookieAsync(orgRole);

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

            //Assert
            Assert.Equal(HttpStatusCode.Forbidden, response.StatusCode);
        }