Пример #1
0
        public void GetPowerByIdTest()
        {
            //Arrange
            var powerId = -1;
            var power   = new Power();

            powerRepositoryMock.Setup(x => x.GetById(powerId))
            .Returns(power)
            .Verifiable("should check in repository via GetById");

            //Act
            var powerDto = powerService.GetPowerById(powerId);

            //Assert
            Assert.IsNotNull(powerDto);
            unitOfWorkMock.Verify();
            powerRepositoryMock.Verify();
        }