Пример #1
0
        public async void DeleteTeam_Fail_TeamDoesNotExist_Test()
        {
            //Arrange
            var toDeleteId = 0;
            _repositoryMock.Setup(r => r.DeleteIfExists(toDeleteId)).Returns(Task.FromResult(false));
            var adapter = new TeamAdapter(_repositoryMock.Object);

            //Act
            var result = await adapter.DeleteIfExists(toDeleteId);

            //Assert
            //Exception must be thrown
        }
Пример #2
0
        public async void DeleteTeam_Success_Test()
        {
            //Arrange 
            var repositoryMock = new Mock<IRepository<StoredTeam>>();
            const int toDeleteId = 0;
            repositoryMock.Setup(r => r.DeleteIfExists(toDeleteId)).Returns(Task.FromResult(true));
            var adapter = new TeamAdapter(repositoryMock.Object);


            //Act

            var result = await adapter.DeleteIfExists(toDeleteId);

            //Assert
            Assert.IsTrue(result);
        }