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));
        }
示例#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;
                }
            }
        }
示例#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;
                }
            }
        }