Exemplo n.º 1
0
 public void Init()
 {
     TestUtil.DeleteDataInDatabase();
     TestUtil.InsertDataDatabase();
     AutoMapperConfiguration.Configure();
     _context = new MicrobrewitContext();
     _breweryElasticsearch = new BreweryElasticsearch();
     // _breweryService = new BreweryService(_repository,_breweryElasticsearch);
     _repository = new BreweryRepository();
     _controller = new BreweryController(_breweryService);
 }
Exemplo n.º 2
0
 public void Test_GetIndex()
 {
     using (var cluster = new Cluster())
     {
         using (var bucket = cluster.OpenBucket("beer-sample"))
         {
             var controller = new BreweryController(new BreweryRepository(bucket));
             var result     = (ViewResult)controller.Index();
             var breweries  = result.Model as List <dynamic>;
             Assert.AreEqual(10, breweries.Count);
         }
     }
 }
 public void TearDown()
 {
     controller = null;
 }
 public void SetUp()
 {
     logic      = new BreweryLogic(new TestBreweryApiMethods());
     controller = new BreweryController(logic);
 }