private async Task StartGame(IDialogContext context, IAwaitable <confirm> result)
        {
            var selection = await result;

            if (selection.ToString().ToLower().Equals("start"))
            {
                game = 1;
                ReadDataFromFile rj = new ReadDataFromFile();
                int count           = 0;
                if (mode.Equals("Easy"))
                {
                    count = rj.ReadWordsFromFile(words, "output.txt");
                }
                else
                {
                    count = rj.ReadWordsFromFile(words, "fiveletterwords.txt");
                }
                await GuessBot(count, context);
            }
            else
            {
                await context.PostAsync("**see u soon :)**");

                var cardMsg    = context.MakeMessage();
                var attachment = BotWelcomeCard2("Have a nice day !!!", "");
                cardMsg.Attachments.Add(attachment);
                await context.PostAsync(cardMsg);
            }
        }
Esempio n. 2
0
        public async Task GetData_ReturnTicketDataObbject_FromTxtFile()
        {
            var ticketsData = await ReadDataFromFile.GetData(_path);

            ticketsData.People.Should().Be(5);
            ticketsData.Windows.Should().Be(2);
            ticketsData.Destinations.Should().HaveCount(c => c == 3);
            ticketsData.PersonDestinations.Should().HaveCount(c => c == 5);
        }
        public static IIndex Provide(string name, DateTime startDate, DateTime endDate, string frequency)
        {
            var historicalData = ReadDataFromFile.ReadDataSeriesFromFile(
                DownloadedFile.ProvideHistoridalDataFile(name, startDate, endDate, frequency));

            var currentPrice = new DataPoint();     //currently not available
            var listOfStocks = new List <IStock>(); //currently not available

            var index = IndexCreator.CreateIndex(name, currentPrice, listOfStocks, historicalData);

            return(index);
        }
Esempio n. 4
0
        public async Task PriceCalculation_ReturnsOutputObject_WhenGettingData()
        {
            var ticketsData = await ReadDataFromFile.GetData(_path);

            var output = App.PriceCalculation(ticketsData);

            var expectedWindowsList = new List <int>()
            {
                1, 1, 2, 1, 1
            };

            output.TotalPrice.Should().Be(49.2M);
            output.Windows.Should().HaveCount(c => c == ticketsData.People);
            output.Windows.Should().BeEquivalentTo(expectedWindowsList);
        }
Esempio n. 5
0
        static async Task Main(string[] args)
        {
            // string path = "Data/Sample.txt";
            // string path2 = "Data/Sample2.txt";
            string path3 = "Data/Sample3.txt";

            var ticketsData = await ReadDataFromFile.GetData(path3);

            var output = App2.PriceCalculation(ticketsData);

            Console.WriteLine("************* RESULTS **************");
            Console.WriteLine("Total Price: " + output.TotalPrice);
            Console.Write("Windows: ");
            foreach (var w in output.Windows)
            {
                Console.Write(w + " ");
            }
            Console.WriteLine();
        }
Esempio n. 6
0
 static void Main(string[] args)
 {
     string path = @"..\..\names.txt";
     ReadDataFromFile readData = new ReadDataFromFile();
     readData.ReadAllDataFromFile(path);
 }