public void ContentTypeController_DeleteContentType_Throws_On_Null_ContentType() { //Arrange var mockDataService = new Mock <IDataService>(); var contentTypeController = new ContentTypeController(mockDataService.Object); //Act, Arrange Assert.Throws <ArgumentNullException>(() => contentTypeController.DeleteContentType(null)); }
public void ContentTypeController_DeleteContentType_Throws_On_Negative_ContentTypeId() { //Arrange var mockDataService = new Mock <IDataService>(); var contentTypeController = new ContentTypeController(mockDataService.Object); ContentType contentType = ContentTestHelper.CreateValidContentType(); contentType.ContentTypeId = Null.NullInteger; //Act, Arrange Assert.Throws <ArgumentOutOfRangeException>(() => contentTypeController.DeleteContentType(contentType)); }
public void ContentTypeController_DeleteContentType_Calls_DataService_On_Valid_ContentTypeId() { //Arrange var mockDataService = new Mock <IDataService>(); var contentTypeController = new ContentTypeController(mockDataService.Object); var contentType = ContentTestHelper.CreateValidContentType(); contentType.ContentTypeId = Constants.CONTENTTYPE_ValidContentTypeId; //Act contentTypeController.DeleteContentType(contentType); //Assert mockDataService.Verify(ds => ds.DeleteContentType(contentType)); }