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); }
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); }
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 ); }
public IList <Query> Fetch() { return(_queryRepository.GetAll()?.ToList()); }