Ejemplo n.º 1
0
        public void GetAllCustomerFromDb()
        {
            // Arange
            var userService = new UsersService(db);

            var firstCustomer = new CustomerUser {
                Id = "0", FullName = "BHTC"
            };
            var secondCustomer = new CustomerUser {
                Id = "1", FullName = "FischerTech"
            };
            var thirdCustomer = new CustomerUser {
                Id = "2", FullName = "InnoTape"
            };

            db.CustomerUser.AddRange(firstCustomer, secondCustomer, thirdCustomer);
            db.SaveChanges();

            // Act
            var result = userService.AllCustomer();

            // Assert
            var expectedCount = 3;

            Assert.Equal(expectedCount, result.Count());
        }