示例#1
0
        public void IsRepositoryAddingUsers()
        {
            var user = new User
            {
                Id = 4,
                Email = "*****@*****.**",
                Password = "******",
                UserName = "******"
            };

            _repo.Add(user);
            _repo.Save();

            var result = _repo.GetAll();
            var numberOfRecords = result.ToList().Count;
            Assert.AreEqual(4, numberOfRecords);
        }
示例#2
0
        public void IsRepositoryRemovingUser()
        {
            var user = new User
            {
                Id = 4,
                Email = "*****@*****.**",
                Password = "******",
                UserName = "******"
            };
            _repo.Add(user);
            _repo.Save();

            var result = _repo.GetAll();
            Assert.IsNotNull(result);
            _repo.Delete(user);

            var isUserRemoved = _repo.GetAll().Select(x => x.Id).FirstOrDefault() == 4;

            Assert.IsFalse(isUserRemoved);
        }