Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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)));
 }