Beispiel #1
0
            public async Task Sucess_PriceServices_CheckIfExists()
            {
                //Arrange
                mockedDao.Invocations.Clear();
                mockedDao.Setup(s => s.CheckIfExists(It.IsAny <long>(), It.IsAny <int>()))
                .ReturnsAsync(this.price);

                //Act
                service = new PriceServices(mockedUnitOfWork.Object, mockedDao.Object);
                int?priceId = await service.CheckIfExists(2, 1);

                //Assert
                Assert.AreEqual(priceId, 1);
                mockedDao.Verify(s => s.CheckIfExists(It.IsAny <long>(), It.IsAny <int>()), Times.Once);
            }