예제 #1
0
        public void ScopeTypeController_DeleteScopeType_Throws_On_Null_ScopeType()
        {
            // Arrange
            var mockDataService     = new Mock <IDataService>();
            var scopeTypeController = new ScopeTypeController(mockDataService.Object);

            // Act, Arrange
            Assert.Throws <ArgumentNullException>(() => scopeTypeController.DeleteScopeType(null));
        }
예제 #2
0
        public void ScopeTypeController_DeleteScopeType_Throws_On_Negative_ScopeTypeId()
        {
            // Arrange
            var mockDataService     = new Mock <IDataService>();
            var scopeTypeController = new ScopeTypeController(mockDataService.Object);

            ScopeType scopeType = ContentTestHelper.CreateValidScopeType();

            scopeType.ScopeTypeId = Null.NullInteger;

            Assert.Throws <ArgumentOutOfRangeException>(() => scopeTypeController.DeleteScopeType(scopeType));
        }
예제 #3
0
        public void ScopeTypeController_DeleteScopeType_Calls_DataService_On_Valid_ContentTypeId()
        {
            // Arrange
            var mockDataService     = new Mock <IDataService>();
            var scopeTypeController = new ScopeTypeController(mockDataService.Object);

            var scopeType = ContentTestHelper.CreateValidScopeType();

            scopeType.ScopeTypeId = Constants.SCOPETYPE_ValidScopeTypeId;

            // Act
            scopeTypeController.DeleteScopeType(scopeType);

            // Assert
            mockDataService.Verify(ds => ds.DeleteScopeType(scopeType));
        }