Пример #1
0
 public void IndexTest()
 {
     StoreController target = new StoreController(); // TODO: Initialize to an appropriate value
     string expected = "Hello from Store.Index()";
     string actual;
     actual = target.Index();
     Assert.AreEqual(expected, actual);
 }
Пример #2
0
 public void DetailsTest()
 {
     StoreController target = new StoreController(); // TODO: Initialize to an appropriate value
     int id = 0; // TODO: Initialize to an appropriate value
     ActionResult expected = null; // TODO: Initialize to an appropriate value
     ActionResult actual;
     actual = target.Details(id);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Пример #3
0
 public void BrowseTest()
 {
     StoreController target = new StoreController(); // TODO: Initialize to an appropriate value
     string genre = string.Empty; // TODO: Initialize to an appropriate value
     ActionResult expected = null; // TODO: Initialize to an appropriate value
     ActionResult actual;
     actual = target.Browse(genre);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Пример #4
0
 public void IndexTest()
 {
     StoreController target = new StoreController();
     string expected = "Hello from Store.Index()";
     string actual;
     actual = target.Index();
     Assert.AreEqual(expected, actual);
 }
Пример #5
0
 public void BrowseTest()
 {
     StoreController target = new StoreController();
     string genre = "Disco";
     string expected = "Store.Browse, Genre = Disco";
     string actual;
     actual = target.Browse(genre);
     Assert.AreEqual(expected, actual);
 }
Пример #6
0
 public void DetailsTest()
 {
     StoreController target = new StoreController();
     int id = 5;
     string expected = "Store.Details, ID = 5";
     string actual;
     actual = target.Details(id);
     Assert.AreEqual(expected, actual);
 }
 public void SetUp()
 {
     catalogFacade = new Mock<ICatalogFacade>();
     storeController = new StoreController(catalogFacade.Object);
 }
Пример #8
0
        public void IndexTest()
        {
            StoreController target = new StoreController();
            ActionResult actual;
            actual = target.Index();
            Assert.IsNotNull(actual);
            Assert.IsInstanceOfType(actual, typeof(ViewResult));

            ViewResult viewResult = (ViewResult)actual;

            Assert.IsInstanceOfType(viewResult.ViewData.Model, typeof(StoreIndexViewModel));

            StoreIndexViewModel model = (StoreIndexViewModel)viewResult.ViewData.Model;

            Assert.AreEqual(10, model.Genres.Count);
            Assert.AreEqual(10, model.NumberOfGenres);
        }
Пример #9
0
        public void BrowseTest()
        {
            StoreController target = new StoreController(); 
            string genre = "Disco"; 

            ActionResult actual;

            actual = target.Browse(genre);
            Assert.IsNotNull(actual);
            Assert.IsInstanceOfType(actual, typeof(ViewResult));

            ViewResult viewResult = (ViewResult)actual;
            Assert.IsNotNull(viewResult.ViewData.Model);
            Assert.IsInstanceOfType(viewResult.ViewData.Model, typeof(StoreBrowseViewModel));

            StoreBrowseViewModel model = (StoreBrowseViewModel)viewResult.ViewData.Model;

            Assert.AreEqual("Disco", model.Genre.Name);
            Assert.AreEqual(3, model.Albums.Count);
        }
Пример #10
0
        public void DetailsTest()
        {
            StoreController target = new StoreController(); 
            int id = 669; 
            ActionResult actual;
            actual = target.Details(id);
            Assert.IsNotNull(actual);
            Assert.IsInstanceOfType(actual, typeof(ViewResult));

            ViewResult viewResult = (ViewResult)actual;

            Assert.IsInstanceOfType(viewResult.ViewData.Model, typeof(Album));

            Album album = (Album) viewResult.ViewData.Model;

            Assert.AreEqual(id, album.AlbumId);
            Assert.AreEqual("Ring My Bell", album.Title);
        }