public void TestMethod1()
 {
     var repository = new QueryRepository<Review>();
     //var serializer = new JsonSerializer();
     //serializer.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
     var review = repository.GetAll()[0];
     var result = JsonConvert.SerializeObject(review);
 }
Пример #2
0
        public void GetAll()
        {
            // arrange
            DbHelper.Seed_SingleBlog(_context);
            var repository = new QueryRepository <Blog, int>(_context);

            // act
            var allItems = repository.GetAll();

            // var actual
            Assert.NotNull(allItems);
            Assert.NotEmpty(allItems);
        }
Пример #3
0
        public void GetAllQueries()
        {
            // Act
            IEnumerable <SqlQuery> queries = queryRepo.GetAll();

            // Assert
            Assert.AreEqual(queriesDbSet.Count(), queries.Count());
            Assert.AreEqual(
                queriesDbSet.First(),
                queries.First()
                );
            Assert.AreEqual(
                queriesDbSet.Last(),
                queries.Last()
                );
            Assert.AreEqual(
                queriesDbSet.First().SqlQueryName,
                queries.First().SqlQueryName
                );
        }
Пример #4
0
 public IList <Query> Fetch()
 {
     return(_queryRepository.GetAll()?.ToList());
 }