コード例 #1
0
        public void TucciConstructor_GivesLifeToANewTamaTucci_ResultIsANewTucci()
        // test to create a single tucci
        {
            Tucci newTucci = new Tucci("Birthatucci");

            Assert.AreEqual(typeof(Tucci), newTucci.GetType());
        }
コード例 #2
0
        public void TucciConstructor_CanFindStartingValuesForLevels_Int()
        {
            string tuccemi = "Steve Buscemi";
            Tucci  myTucci = new Tucci(tuccemi);

            int levelResult = myTucci.HappinessLevel;

            Assert.AreEqual(10, levelResult);
        }
コード例 #3
0
        public void TucciLevelStats_CanValuesBeAddedDirectlyToLevelValues_Yes()
        {
            string tuccemi = "Steve Buscemi";
            Tucci  myTucci = new Tucci(tuccemi);

            myTucci.HappinessLevel += 5;
            int testingLevelMath = myTucci.HappinessLevel;

            Assert.AreEqual(15, testingLevelMath);
        }
コード例 #4
0
        public void TucciConstructor_InstantiatesWithAnIDAndGetAReturn_Int()
        // test to assign an id to a tucci
        {
            string TucciName = "Jeff Goldblum";
            Tucci  newTucci  = new Tucci(TucciName);

            int result = newTucci.Id;

            Assert.AreEqual(1, result);
        }
コード例 #5
0
        // test to save the name of an individual tucci
        public void TucciConstructor_SavesNameOfIndividualTucci_String()
        {
            string tucciName = "Jeff Goldblum";

            Tucci newTucci = new Tucci("Jeff Goldblum");
            //converting Tucci into a string to then test
            string tucciFromTucci = newTucci.TucciName;

            Assert.AreEqual(tucciName, tucciFromTucci);
        }
コード例 #6
0
        // test to retrieve a single tucci (by id)
        public void Find_ReturnsSingleTucci_Tucci()
        {
            string tucciOne      = "Jeff Goldblum";
            string tucciTwo      = "Tom Cruise";
            string tucciThree    = "Steve Buscemi";
            Tucci  newTucciOne   = new Tucci(tucciOne);
            Tucci  newTucciTwo   = new Tucci(tucciTwo);
            Tucci  newTucciThree = new Tucci(tucciThree);

            Tucci result = Tucci.Find(3);

            Assert.AreEqual(newTucciThree, result);
        }
コード例 #7
0
        public void TucciConstructor_MultipleTuccisAddedToListAndAreTargettedByID_RESULT()
        // test to assign an id to a tucci
        {
            string tucciOne      = "Jeff Goldblum";
            string tucciTwo      = "Tom Cruise";
            string tucciThree    = "Steve Buscemi";
            Tucci  newTucciOne   = new Tucci(tucciOne);
            Tucci  newTucciTwo   = new Tucci(tucciTwo);
            Tucci  newTucciThree = new Tucci(tucciThree);

            int result = newTucciThree.Id;

            Assert.AreEqual(3, result);
        }
コード例 #8
0
 public void Dispose()
 {
     Tucci.ClearAll();
 }
コード例 #9
0
        public ActionResult Index()
        {
            List <Tucci> allTuccis = Tucci.GetAll();

            return(View(allTuccis));
        }
コード例 #10
0
        public ActionResult Show(int id)
        {
            Tucci foundTucci = Tucci.Find(id);

            return(View(foundTucci));
        }
コード例 #11
0
 public ActionResult Delete()
 {
     Tucci.ClearAll();
     return(View());
 }
コード例 #12
0
        public ActionResult Create(string tucciName)
        {
            Tucci myTucci = new Tucci(tucciName);

            return(RedirectToAction("Index"));
        }