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