Exemplo n.º 1
0
        public void Simple_Update_With_Integers()
        {
            var temp = new ListRepository<int>(new List<int> { 1, 2, 3, 4, 5 });
            temp.Update(5);

            Assert.AreEqual(temp.ToList()[4], 5);
        }
Exemplo n.º 2
0
        public void Simple_Update_With_Integers_No_Match()
        {
            var temp = new ListRepository<int>(new List<int> { 1, 2, 3, 4, 5 });
            temp.Update(9);

            Assert.AreNotEqual(temp.ToList()[4], 9);
        }
Exemplo n.º 3
0
        public void Simple_Select_With_Integers_And_No_Match()
        {
            var temp = new ListRepository<int>(new List<int> { 1, 2, 3, 4, 5 });

            var value = temp.FirstOrDefault(val => val == 9);
            Assert.AreNotEqual(value, 9);
        }
Exemplo n.º 4
0
        public void Simple_Select_With_Syntactic_Sugar_Integers()
        {
            var temp = new ListRepository<int>(new List<int> { 1, 2, 3, 4, 5 });
            var value = (from val in temp where val == 2 select val).FirstOrDefault();

            Assert.AreEqual(value, 2);
        }
Exemplo n.º 5
0
        public void Simple_Select_With_Integers()
        {
            var temp = new ListRepository<int>(new List<int> { 1, 2, 3, 4, 5});

            var value = temp.FirstOrDefault(val => val == 2);
            Assert.AreEqual(value, 2);
        }
Exemplo n.º 6
0
 public PatientController()
 {
     _patientService = new PatientService(GetConnection());
     _visitService   = new VisitService(GetConnection());
     _listRepository = new ListRepository(GetConnection());
     _patientGateway = new PatientGateway();
 }
Exemplo n.º 7
0
        public void Simple_Remove_With_Integers_No_Match()
        {
            var temp = new ListRepository<int>(new List<int> { 1, 2, 3, 4, 5 });
            var count = temp.Count();

            temp.Remove(9);

            Assert.AreEqual(count, temp.Count());
        }
Exemplo n.º 8
0
        /// <summary>
        /// View all your lists.
        /// </summary>
        public static void ViewAll()
        {
            System.Console.WriteLine("Here are your lists:");

            var lists = ListRepository.ReadAll();

            foreach (var list in lists)
            {
                Print.Color("green", "\n" + list.CreatedDateTime + " | ID: " + list.ListId + " | " +
                            list.Title + "\n");
            }

            Startup.Introduction();
        }
Exemplo n.º 9
0
        public void ListRepository_Add_IsNotNullWhenGet()
        {
            var dbData = new DalList
            {
                Id = 100,
                Description = "aaa",
                Title = "aaa"
            };
            var dbSetMock = new Mock<DbSet<OrmList>>();
            var dbContextMock = new Mock<EntityModelContext>();
            dbContextMock.Setup(x => x.Set<OrmList>()).Returns(dbSetMock.Object);

            var repo = new ListRepository(dbContextMock.Object);
            repo.Add(dbData);
            Assert.IsNotNull(repo.Get(100));
        }
Exemplo n.º 10
0
 public ListService(ListRepository repository)
 {
     _repository = repository;
 }
Exemplo n.º 11
0
 public AuthController()
 {
     userRepo = new UserRepository();
     listRepo = new ListRepository();
 }
Exemplo n.º 12
0
 public ListController()
 {
     listRepo = new ListRepository();
     listMovieRepo = new ListMovieRepository();
     listModel = new List();
 }
Exemplo n.º 13
0
        public void Valid_Creation_Of_Instance_With_Empty_Seed()
        {
            var temp = new ListRepository<int>(new List<int>());

            Assert.IsNotNull(temp);
            Assert.IsEmpty(temp.ToList());
        }
Exemplo n.º 14
0
 static void Main(string[] args)
 {
     var listRepository = new ListRepository<TestEntity>(ListUrl, ListName);
     var items = listRepository.FindAll();
     Console.WriteLine(items.Count);
 }