public async Task Create_CreateForbidden_ReturnsForbidden() { // Arrange var restrictedController = new AnyAsyncReadOnlyController(repository, logger); var entity = new AnyEntity(); // Act var result = await restrictedController.Create(entity) as ObjectResult; // Assert result.Should().NotBeNull(); result.StatusCode.Should().Be(403); A.CallTo(() => repository.Create(entity)).MustNotHaveHappened(); }
public async Task Create_CreateForbidden_ReturnsForbidden() { // TODO: Create Async ReadOnly Controller // Arrange var readOnlyController = new AnyAsyncReadOnlyController(_repository, _logger); var model = new AnyModel(); // Act var result = await readOnlyController.Create(model) as ObjectResult; // Assert result.Should().NotBeNull(); result.StatusCode.Should().Be(403); A.CallTo(() => _repository.CreateAsync(model)).MustNotHaveHappened(); }