Exemplo n.º 1
0
        public void GetSetAdjectiveOne_GetSetsAdjectiveOne_String()
        {
            MadLibs newGame = new MadLibs();

            newGame.SetAdjectiveOne("run");
            Assert.AreEqual("run", newGame.GetAdjectiveOne());
        }
Exemplo n.º 2
0
        public void GetSetNounOne_GetSetsNounOne_String()
        {
            MadLibs newGame = new MadLibs();

            newGame.SetNounOne("Gizmo");
            Assert.AreEqual("Gizmo", newGame.GetNounOne());
        }
Exemplo n.º 3
0
        public void GetSetOccupation_GetsSetsOccupation_String()
        {
            MadLibs newGame = new MadLibs();

            newGame.SetOccupation("Farmer");
            Assert.AreEqual("Farmer", newGame.GetOccupation());
        }
Exemplo n.º 4
0
        public void Talk_NotEnoughParts_ReturnEmptyString()
        {
            var parts = new PartsOfSpeech();

            string result = MadLibs.Talk(parts);

            Assert.That(result, Is.Empty);
        }
Exemplo n.º 5
0
        public void Talk_AnotherFullParts_ReturnStoryUsedAllParts()
        {
            var parts = new PartsOfSpeech()
            {
                Noun      = "apple",
                Verb      = "throw",
                Adjective = "cute",
                Adverb    = "perfectly"
            };

            string result = MadLibs.Talk(parts);

            Assert.That(result, Is.EqualTo("Do you throw your cute apple perfectly? That's hilarious!"));
        }
Exemplo n.º 6
0
        public void Talk_FullParts_ReturnStoryUsedAllParts()
        {
            var parts = new PartsOfSpeech()
            {
                Noun      = "dog",
                Verb      = "walk",
                Adjective = "blue",
                Adverb    = "quickly"
            };

            string result = MadLibs.Talk(parts);

            Assert.That(result, Is.EqualTo("Do you walk your blue dog quickly? That's hilarious!"));
        }
Exemplo n.º 7
0
        public ActionResult MadLibsResults()
        {
            MadLibs newGame = new MadLibs();

            newGame.SetOccupation(Request.Query["occupation"]);
            newGame.SetNounOne(Request.Query["nounOne"]);
            newGame.SetNounTwo(Request.Query["nounTwo"]);
            newGame.SetNounThree(Request.Query["nounThree"]);
            newGame.SetNounFour(Request.Query["nounFour"]);
            newGame.SetAdjectiveOne(Request.Query["adjectiveOne"]);
            newGame.SetAdjectiveTwo(Request.Query["adjectiveTwo"]);
            newGame.SetVerbOne(Request.Query["verbOne"]);
            newGame.SetVerbTwo(Request.Query["verbTwo"]);
            newGame.SetVerbThree(Request.Query["verbThree"]);
            return(View(newGame));
        }
Exemplo n.º 8
0
    public static void Main()
    {
        MadLibs greet = new MadLibs();

        Console.WriteLine("Enter a noun:");
        string noun = Console.ReadLine();

        Console.WriteLine("Enter a verb: ");
        string verb = Console.ReadLine();

        Console.WriteLine("Enter an adjective: ");
        string adj = Console.ReadLine();

        Console.WriteLine("Enter an adverb: ");
        string adv = Console.ReadLine();

        Console.WriteLine("Do you " + verb + " you " + adj + " " + noun + " " + adv + "? That's hilarious!");
    }
Exemplo n.º 9
0
        public ActionResult MadLib(string nounOne, string nounTwo, string nounThree, string verbOne, string verbTwo, string verbThree, string adjOne, string adjTwo, string adjThree, string adverbOne, string adverbTwo, string adverbThree)
        {
            MadLibs myMadLibs = new MadLibs();

            myMadLibs.NounOne   = nounOne;
            myMadLibs.NounTwo   = nounTwo;
            myMadLibs.NounThree = nounThree;

            myMadLibs.VerbOne   = verbOne;
            myMadLibs.VerbTwo   = verbTwo;
            myMadLibs.VerbThree = verbThree;

            myMadLibs.AdjOne   = adjOne;
            myMadLibs.AdjTwo   = adjTwo;
            myMadLibs.AdjThree = adjThree;

            myMadLibs.AdverbOne   = adverbOne;
            myMadLibs.AdverbTwo   = adverbTwo;
            myMadLibs.AdverbThree = adverbThree;
            return(View(myMadLibs));
        }