Пример #1
0
        public void TestGetByEmail()
        {
            Tourist testTourist = new Tourist()
            {
                Id       = 1,
                Name     = "Pepe",
                LastName = "Lopez",
                Email    = "*****@*****.**",
                Bookings = null,
            };
            List <Tourist> touristList = new List <Tourist>()
            {
                new Tourist()
                {
                    Id       = 2,
                    Name     = "Pepe",
                    LastName = "Lopez",
                    Email    = "*****@*****.**",
                    Bookings = null,
                }, testTourist
            };

            touristList.ForEach(s => _context.Add(s));
            _context.SaveChanges();
            var repository = new TouristRepository(_context);

            var result = repository.GetByEmail("*****@*****.**");

            Assert.IsTrue(testTourist.Equals(result));
        }
Пример #2
0
        public void TestEqualsExpectedTrue()
        {
            tourist.Id    = 1;
            tourist.Email = "*****@*****.**";
            Tourist test = new Tourist
            {
                Id    = 1,
                Email = "*****@*****.**"
            };

            Assert.IsTrue(tourist.Equals(test));
        }