public void Delete_WhenFixturePositionIsNotAvailable_ShouldThrowLogicException() { // Arrange Guid fixtureId = Guid.NewGuid(); var mockFixtureDal = new MockFixtureDal().MockUpdate().MockGet(new Fixture() { FixturePositionId = 2 }); var sut = new FixtureManager(mockFixtureDal.Object); // Act & Assert Assert.Throws <LogicException>(() => sut.Delete(fixtureId)); }
public void Delete_WhenDeletedFixture_ShouldUpdateFixturePosition() { // Arrange Guid fixtureId = Guid.NewGuid(); var mockFixtureDal = new MockFixtureDal().MockUpdate().MockGet(new Fixture() { FixturePositionId = 1 }); var sut = new FixtureManager(mockFixtureDal.Object); // Act sut.Delete(fixtureId); // Assert mockFixtureDal.VerifyUpdate(Times.Once()); }
//[Route("api/teams/{id}")] public string Delete(int id) { return(JsonConvert.SerializeObject(_fixtureService.Delete(id))); }