public OrdersListViewModelTests()
        {
            var fixture = new OmitRecursionFixture();

            _orders = fixture.CreateMany <Order>();
            _ordersListViewModel = new OrdersListViewModel();
        }
예제 #2
0
        public OrderTests()
        {
            var fixture = new OmitRecursionFixture();

            _orderDetails = fixture.CreateMany <OrderDetail>().ToList();

            _customer = fixture.Create <Customer>();

            _orderPlaced = fixture.Create <DateTime>();

            _order = new Order();
        }
예제 #3
0
        public CategoryTests()
        {
            _category = new Category();

            var fixture = new OmitRecursionFixture();

            _shopItems = fixture.CreateMany <ShopItem>().ToList();

            fixture.Freeze <Category>();
            _categoryLeft  = fixture.Create <Category>();
            _categoryRight = fixture.Create <Category>();
        }
예제 #4
0
        public void TestCreateShouldReturnOrdersListViewModel()
        {
            //Arrange
            const int testPageSize  = 2;
            const int testPageIndex = 1;
            var       fixture       = new OmitRecursionFixture();
            var       orders        = fixture.CreateMany <Order>().ToList();
            var       sut           = new OrdersListViewModelFactory();

            //Act
            var result = sut.Create(orders, testPageSize, testPageIndex);

            //Assert
            Assert.Equal(testPageSize, result.PageSize);
            Assert.Equal(testPageIndex, result.PageIndex);
            Assert.Equal(orders.Take(2), result.Orders);
        }