Browse() public method

public Browse ( string genre ) : System.Web.Mvc.ActionResult
genre string
return System.Web.Mvc.ActionResult
Exemplo n.º 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.");
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
        }