Browse() 공개 메소드

public Browse ( string genre ) : System.Web.Mvc.ActionResult
genre string
리턴 System.Web.Mvc.ActionResult
예제 #1
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.");
 }
예제 #2
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);
 }
예제 #3
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);
        }