コード例 #1
0
        public async Task LotService_GetByIdWithDetails_ReturnsProperLot()
        {
            var expected       = GetTestLotsModels().First();
            var mockUnitOfWork = new Mock <IUnitOfWork>();

            mockUnitOfWork
            .Setup(m => m.LotRepository.GetByIdWithDetailsAsync(It.IsAny <int>()))
            .ReturnsAsync(GetTestLotsEntities().First());
            var lotService = new LotService(mockUnitOfWork.Object, UnitTestHelper.CreateMapperProfile());

            var actual = await lotService.GetByIdAsync(expected.Id);

            Assert.AreEqual(expected.Id, actual.Id);
            Assert.AreEqual(expected.SaleType, actual.SaleType);
            Assert.AreEqual(expected.TurnkeyPrice, actual.TurnkeyPrice);
            Assert.AreEqual(expected.IsActive, actual.IsActive);
        }