Ejemplo n.º 1
0
        public async Task GetOrdersByUsernameAsync_WithUsernameAndPage_ShouldReturnValidServiceModel()
        {
            // Arrange
            FitStoreDbContext database = this.Database;

            DatabaseHelper.SeedData(database);

            IAdminUserService adminUserService = new AdminUserService(database);

            // Act
            AdminUserOrdersServiceModel result = await adminUserService.GetOrdersByUsernameAsync(firstUsername, page);

            // Assert
            result.Username.Should().Be(firstUsername);
            result.Address.Should().Be(firstAddress);
            result.Email.Should().Be(firstEmail);
            result.Orders.Count().Should().Be(2);
        }