Exemplo n.º 1
0
        public void getCarPriceTest_noresponse()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
            }
                                                     );
            var intent          = new GetPrice();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "A new 2002 Toyota Camry has a starting price of 23700.");
        }
Exemplo n.º 2
0
        public void getCarPriceTest_nonsense()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "jhgfjh", "University of the Texas at Arlington" },
            }
                                                     );
            var intent          = new GetPrice();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "Hmm. I can't seem to find the price at this time.");
        }
Exemplo n.º 3
0
        public void getCarPriceTest_onlymodel()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Model", "Camry" },
            }
                                                     );
            var intent          = new GetPrice();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "What's the make of the car?");
        }
Exemplo n.º 4
0
        public void getCarPriceTest_2nonmandatory()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Make", "Toyota" },
                { "Year", "2012" },
            }
                                                     );
            var intent          = new GetPrice();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "What's the model of the car?");
        }
Exemplo n.º 5
0
        //Get Price - all 3 parameters provided - missing full year (Year, Make, Model) - 2002
        public void getCarPriceTest_3notfullyear()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Make", "Toyota" },
                { "Model", "Camry" },
                { "Year", "02" }
            }
                                                     );
            var intent          = new GetPrice();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "The 2002 Toyota Camry has a starting price of 23700.");
        }
Exemplo n.º 6
0
        //Get Price - all 3 parameters provided - missing full model info (Year, Make, Model) - //SHOULD WE ASK FOR MODIFIED MODELS?
        public void getCarPriceTest_3notfullmodel()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Make", "Mazda" },
                { "Model", "CX" },
                { "Year", "2014" }
            }
                                                     );
            var intent          = new GetPrice();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "Hmm. I can't seem to find the price at this time.");
        }
Exemplo n.º 7
0
        //Get Price - all 3 parameters provided - hyphenated make (Year, Make, Model)
        public void getCarPriceTest_3hyphen()
        {
            // User says Mercedes Benz. Should match against mercedes-benz
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Make", "Mercedes Benz" },
                { "Model", "S Class" },
                { "Year", "2012" }
            }
                                                     );
            var intent          = new GetPrice();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "The 2012 Mercedes-Benz S Class has a starting price of 158050.");
        }
Exemplo n.º 8
0
        public void getCarPriceTest_3good()
        {
            // Arrange
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Make", "BMW" },
                { "Model", "5 Series" },
                { "Year", "2014" }
            }
                                                     );
            var intent          = new GetPrice();
            var edmundsURL      = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "A new 2014 BMW 5 Series has a starting price of 63900");
        }
Exemplo n.º 9
0
        public void getCarPriceTest()
        {
            // Arrange
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary <string, string>()
            {
                { "Make", "Dodge" },
                { "Model", "Dart" },
                { "Year", "2013" }
            }
                                                     );
            var intent     = new GetPrice();
            var edmundsURL = intent.GenEdmundsURL();

            Assert.AreEqual("https://api.edmunds.com/api/vehicle/v2/Dodge/Dart/2013/styles?view=full&fmt=json&api_key=67t7jtrnvz8wyzgfpwgcqa3y", edmundsURL);

            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse   = intent.GetAlexaResponse();
        }