Ejemplo n.º 1
0
        public void Delete()
        {
            // Arrange
            SettingsController controller = new SettingsController();

            // Act
            controller.Delete(5);

            // Assert
        }
Ejemplo n.º 2
0
        public void SettingsControllerConflict()
        {
            var settings      = Mock.Of <IDeploymentSettingsManager>();
            var operationLock = new Mock <IOperationLock>();

            // setup
            operationLock.Setup(l => l.Lock())
            .Returns(false);

            var controller = new SettingsController(settings, operationLock.Object)
            {
                Request = new HttpRequestMessage()
            };

            var response = controller.Set(new JObject());

            Assert.Equal(HttpStatusCode.Conflict, response.StatusCode);

            response = controller.Delete("dummy");
            Assert.Equal(HttpStatusCode.Conflict, response.StatusCode);
        }