public void Passing_NullInputModel_ReturnsBadRequestStatus() { //Arrange var controller = new MassRehireController(dataFactory.Object, authorization.Object, mappingFactory); //Act Task <IHttpActionResult> result = controller.SetDataAsync(ValidGroupID, null); //Assert Assert.IsInstanceOfType(result.Result, typeof(BadRequestResult)); }
public void Passing_NullGroupID_ShouldReturnaBadRequestStatus() { //Arrange var controller = new MassRehireController(dataFactory.Object, authorization.Object, mappingFactory); // Act Task <IHttpActionResult> actionResult = controller.SetDataAsync(null, models); //Assert Assert.IsInstanceOfType(actionResult.Result, typeof(BadRequestResult)); }
public void Passing_AuthorisableGroupID_ToControllerReturnsOkResult() { //Arrange var controller = new MassRehireController(dataFactory.Object, authorization.Object, mappingFactory); // Act Task <IHttpActionResult> actionResult = controller.SetDataAsync(ValidGroupID, models); //Assert Assert.IsInstanceOfType(actionResult.Result, typeof(OkResult)); }
public void MakingUnauthorised_RequestToMassRehire_ReturnsUnauthorisedStatus() { //Arrange authorization.Setup(a => a.IsAuthorized(ValidGroupID)).Returns(false); var controller = new MassRehireController(dataFactory.Object, authorization.Object, mappingFactory); //Act var actionResult = controller.SetDataAsync(ValidGroupID, models); //Assert Assert.IsInstanceOfType(actionResult.Result, typeof(UnauthorizedResult)); }