public void TestGetSpecification()
        {
            string testmodel1 = "MX400";
            string output1    = "MX400\n   Portable\n   9 Inch Touch Screen\n   Wireless Data transfer to EMR\n   For more inforrmation visit : https://www.philips.co.in/healthcare/product/HC866060/intellivue-mx400-portablebedside-patient-monitortient-monitoring";

            Assert.AreEqual(output1, MonitorAccessor.GetSpecification(testmodel1));
        }
Ejemplo n.º 2
0
        private static void GetMonitorsBasedOnSpecs()
        {
            Bot.PrintLine("These are the different specifications present ");
            string AllSpec1 = Logic.GetAllSpec("Spec1");
            string AllSpec2 = Logic.GetAllSpec("Spec2");

            Bot.PrintData(AllSpec1);
            string spec1num = Bot.Prompt("Please select the specification in the above category which you want to search for");
            string spec1    = Logic.ReturnSpec(Int32.Parse(spec1num), "Spec1");

            Bot.PrintData(AllSpec2);
            string spec2num = Bot.Prompt("Please select the specification in the above category which you want to search for");
            string spec2    = Logic.ReturnSpec(Int32.Parse(spec2num), "Spec2");

            Bot.PrintLine("Model Numbers with your required specifications are: ");
            string modelsOnSpecs = MonitorAccessor.GetModelOnSpecifications(spec1, spec2);

            Bot.PrintData(modelsOnSpecs);
            string modelNameSentence = Bot.Prompt("Select the model you want to inquire about");
            string modelName         = Logic.ExtractKeyword(modelsOnSpecs, modelNameSentence).ToUpper();

            while (true)
            {
                while (!modelsOnSpecs.Contains(modelName))
                {
                    modelNameSentence = Bot.Prompt(
                        "The model you selected does not have the specification which you specified or is not available with us. Please enter the model name which has {0} as the specification");
                    modelName = Logic.ExtractKeyword(modelsOnSpecs, modelNameSentence).ToUpper();
                }
                Bot.PrintData(MonitorAccessor.GetSpecification(modelName));
                string buyMonitor = Bot.Prompt("Do you want to select this product?");
                if (buyMonitor.Contains("yes"))
                {
                    cart.Monitors.Add(modelName);
                    Bot.PrintLine("The product is successfully added to your cart.");
                }
                modelNameSentence = Bot.Prompt("Do you want the full specifications for more models? If Yes, Please specify the Model name.");
                if (modelNameSentence.Contains("what") || modelNameSentence.Contains("show"))
                {
                    Bot.PrintData(modelsOnSpecs);
                    modelNameSentence = Bot.Prompt("Here you go, These are the models of the specification which you specified. Please choose one");
                }
                modelName = Logic.ExtractKeyword(modelsOnSpecs, modelNameSentence).ToUpper();
                if (modelNameSentence.Contains("no"))
                {
                    return;
                }
            }
        }
Ejemplo n.º 3
0
        //private static void GetMonitorsBasedOnSpecs()
        //{
        //    Bot.PrintLine("These are the specifications which are available : ");
        //    string allDistinctSpecs = MonitorAccessor.GetDistinctSpecs();
        //    Bot.PrintData(allDistinctSpecs);
        //    string UserQuerySentence = Bot.Prompt("Please give me your specifications of the Monitor you are expecting");
        //    allDistinctSpecs = allDistinctSpecs.ToLower();
        //    string UserQuery = Logic.ExtractKeyword(allDistinctSpecs, UserQuerySentence);
        //    while (!(allDistinctSpecs.Contains(UserQuery)))
        //    {
        //        UserQuerySentence = Bot.Prompt("Sorry, No monitor is available for this specification.Please tell us any other specification.");
        //        if (UserQuerySentence.Contains("show") || UserQuerySentence.Contains("all") ||
        //            UserQuerySentence.Contains("what"))
        //        {
        //            Bot.PrintData(allDistinctSpecs);
        //            UserQuerySentence=Bot.Prompt("Here you go, These are all the different specifications that the monitors have. Please specify your need");
        //        }
        //        UserQuery = Logic.ExtractKeyword(allDistinctSpecs, UserQuerySentence);
        //    }
        //    Bot.PrintLine("Model Numbers with {0} as a specification are: ",UserQuery);
        //    string modelsOnSpecs = MonitorAccessor.GetModelOnSpecifications(UserQuery);
        //    Bot.PrintData(modelsOnSpecs);
        //    string modelNameSentence = Bot.Prompt("Select the model you want to inquire about");
        //    string modelName = Logic.ExtractKeyword(modelsOnSpecs, modelNameSentence).ToUpper();
        //    while (true)
        //    {
        //        while (!modelsOnSpecs.Contains(modelName))
        //        {
        //            modelNameSentence = Bot.Prompt(
        //                "The model you selected does not have {0} as a specification or is not available with us. Please enter the model name which has {0} as the specification",
        //                UserQuery);
        //            modelName = Logic.ExtractKeyword(modelsOnSpecs, modelNameSentence).ToUpper();
        //        }
        //        Bot.PrintData(MonitorAccessor.GetSpecification(modelName));
        //        string buyMonitor = Bot.Prompt("Do you want to select this product?");
        //        if (buyMonitor.Contains("yes"))
        //        {
        //            Cart.Monitors.Add(modelName);
        //            Bot.PrintLine("The product is successfully added to your cart.");
        //        }
        //        modelNameSentence = Bot.Prompt("Do you want the full specifications for more models? If Yes, Please specify the Model name.");
        //        if (modelNameSentence.Contains("what") || modelNameSentence.Contains("show"))
        //        {
        //            Bot.PrintData(modelsOnSpecs);
        //            modelNameSentence=Bot.Prompt("Here you go, These are the models of the specification '{0}'. Please choose one",UserQuery);
        //        }
        //        modelName = Logic.ExtractKeyword(modelsOnSpecs, modelNameSentence).ToUpper();
        //         if (modelNameSentence.Contains("no"))
        //         {
        //             return;
        //         }
        //    }
        //}

        private static void GetMonitorsBasedOnCategory()
        {
            Bot.PrintLine("Categories are mentioned below:");
            string allCategories = MonitorAccessor.GetSerialName();

            Bot.PrintData(allCategories);
            string categorySentence = Bot.Prompt("Select the Category you want to purchase?");
            string category         = Logic.ExtractKeyword(allCategories, categorySentence);

            while (!allCategories.Contains(category) && category.Contains(""))
            {
                categorySentence = Bot.Prompt("Sorry, This category is not available. Please enter the available categories with us.");
                category         = Logic.ExtractKeyword(allCategories, categorySentence);
            }
            Bot.PrintLine("Model Numbers of the category '{0}' are mentioned below:", category);
            string modelOnCategory = MonitorAccessor.GetModels(category);

            Bot.PrintData(modelOnCategory);
            string modelNameSentence = Bot.Prompt("Select the model you want to inquire about");
            string modelName         = Logic.ExtractKeyword(modelOnCategory, modelNameSentence).ToUpper();

            while (true)
            {
                while (!modelOnCategory.Contains(modelName))
                {
                    modelNameSentence = Bot.Prompt("The model you selected is not present in the '{0}' category. Please specify the model that is present in the selected category.", category);
                    modelName         = Logic.ExtractKeyword(modelOnCategory, modelNameSentence).ToUpper();
                }
                Bot.PrintData(MonitorAccessor.GetSpecification(modelName));
                string buyMonitor = Bot.Prompt("Do you want to select this product?");
                if (buyMonitor.Contains("yes"))
                {
                    cart.Monitors.Add(modelName);
                    Bot.PrintLine("The product is successfully added to your cart.");
                }
                modelNameSentence = Bot.Prompt("Do you want the full specifications for more models? If Yes, Please specify the Model name.");
                if (modelNameSentence.Contains("what") || modelNameSentence.Contains("show"))
                {
                    Bot.PrintData(modelOnCategory);
                    modelNameSentence = Bot.Prompt("Here you go, These are the models of category '{0}'.Please choose one", category);
                }
                modelName = Logic.ExtractKeyword(modelOnCategory, modelNameSentence).ToUpper();
                if (modelNameSentence.Contains("no"))
                {
                    return;
                }
            }
        }
        public void TestGetModelsOnSpec()
        {
            string models1    = "MX400\nVM1\nVM4";
            string models2    = "MX700\nMX800\nCM SERIES";
            string models3    = "MP5\nVSI";
            string test1spec2 = "9 Inch Touch Screen";
            string test1spec1 = "Portable";
            string test2spec2 = "15 Inch Touch Screen";
            string test2spec1 = "Non-Portable";
            string test3spec2 = "5.5 Inch Touch Screen";
            string test3spec1 = "Portable";

            Assert.AreEqual(models1, MonitorAccessor.GetModelOnSpecifications(test1spec1, test1spec2));
            Assert.AreEqual(models2, MonitorAccessor.GetModelOnSpecifications(test2spec1, test2spec2));
            Assert.AreEqual(models3, MonitorAccessor.GetModelOnSpecifications(test3spec1, test3spec2));
        }
        public void TestGetModelsFromCategory()
        {
            string category1 = "bedside monitor";
            string category2 = "high end monitors";
            string category3 = "vital signs monitor";
            string category4 = "maternity and fetal monitor";
            string models1   = "MX400\nMX450\nMX500\nMX550\nMX700\nMX800\nMP2\nMP5";
            string models2   = "CM SERIES\nCMS200";
            string models3   = "VM1\nVM4\nVM6\nVM8\nVSI\nVS2+";
            string models4   = "CL\nFM20\nFM30\nFM40\nFM50";

            Assert.AreEqual(models1, MonitorAccessor.GetModels(category1));
            Assert.AreEqual(models2, MonitorAccessor.GetModels(category2));
            Assert.AreEqual(models3, MonitorAccessor.GetModels(category3));
            Assert.AreEqual(models4, MonitorAccessor.GetModels(category4));
        }
        public void TestGetCategories()
        {
            string output = "bedside monitor\nhigh end monitors\nmaternity and fetal monitor\nvital signs monitor";

            Assert.AreEqual(output, MonitorAccessor.GetSerialName());
        }
        public void TestGetDistinctModelNames()
        {
            string output = "CL\nCM SERIES\nCMS200\nFM20\nFM30\nFM40\nFM50\nMP2\nMP5\nMX400\nMX450\nMX500\nMX550\nMX700\nMX800\nVM1\nVM4\nVM6\nVM8\nVS2+\nVSI";

            Assert.AreEqual(output, MonitorAccessor.GetDistinctModelNames());
        }
        public void TestGetDistinctSpecs()
        {
            string output = "Non-Portable\nPortable\n12 Inch Touch Screen\n15 Inch Touch Screen\n4.5 Inch Touch Screen\n5.5 Inch Touch Screen\n9 Inch Touch Screen\nNA";

            Assert.AreEqual(output, MonitorAccessor.GetDistinctSpecs());
        }