示例#1
0
        public void getCarTest_2nonmandatorymakeyr()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary<string, string>()
                {
                    {"Make", "Toyota" },
                    {"Year", "2012" },
                }
            );
            var intent = new SelectCar();
            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?");
        }
        public void SelectCare2()
        {
            // Arrange
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary<string, string>()
                {
                    {"Make", "Dodge" },
                    {"Model", "Dart" },
                    {"Year", "2013" }
                }
            );
            var intent = new SelectCar();
            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();
            // Assert.AreEqual("Dodge Dart have 36", edmundsResponse);

            // Act

            // Assert
        }
示例#3
0
        public void getCarTest_3badmake()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary<string, string>()
                {
                    {"Make", "Mazda" },
                    {"Model", "Camry" },
                    {"Year", "1995" }
                }
            );
            var intent = new SelectCar();
            var edmundsURL = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "I don't have that car in my records. Hm try again later.");
        }
示例#4
0
        public void getCarTest_onlymodel()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary<string, string>()
                {
                    {"Model", "Camry" },
                }
            );
            var intent = new SelectCar();
            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?");
        }
示例#5
0
        public void getCarTest_nonsense()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary<string, string>()
                {
                    {"m","University of the Texas at Arlington" },
                }
            );
            var intent = new SelectCar();
            var edmundsURL = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "I don't know at this time.");
        }
示例#6
0
        public void getCarTest_3notfullyear()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary<string, string>()
                {
                    {"Make", "Toyota" },
                    {"Model", "Camry" },
                    {"Year", "02" }
                }
            );
            var intent = new SelectCar();
            var edmundsURL = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "The Camry manufactured by Toyota was first made in 1990. The last year the Camry was made was in 2016");
        }
示例#7
0
        public void getCarTest_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 SelectCar();
            var edmundsURL = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "The 5 Series manufactured by BMW was first made in 1994. The last year the 5 Series was made was in 2017.");
        }
示例#8
0
        public void getCarTest_3good()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary<string, string>()
                {
                    {"Make", "BMW" },
                    {"Model", "5 Series" },
                    {"Year", "2014" }
                }
            );
            var intent = new SelectCar();
            var edmundsURL = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "The 5 Series manufactured by BMW was first made in 1990. The last year the 5 Series was made was in 2016.");
        }
示例#9
0
        public void getCarTest_3badyr()
        {
            AlexaService.Cache.CacheManager.AddSlots(new Dictionary<string, string>()
                {
                    {"Make", "Acura" },
                    {"Model", "ILX" },
                    {"Year", "2012" }
                }
            );
            var intent = new SelectCar();
            var edmundsURL = intent.GenEdmundsURL();
            var edmundsResponse = intent.GetEdmundsResponse();
            var AlexaResponse = intent.GetAlexaResponse();

            Assert.AreEqual(AlexaResponse.response.outputSpeech.text, "The ILX manufactured by Acura was first made in 2013. The last year the ILX was made was in 2016.");
        }