public void TestGetDescriptionUnannotated()
        {
            const string EXPECTED = "Unannotated";

            const TestEnum TESTER = TestEnum.Unannotated;
            var            actual = TESTER.GetDescription();

            Assert.Equal(EXPECTED, actual);
        }
Esempio n. 2
0
        private async Task CreateReplies(int amount)
        {
            Random rnd = new Random();

            List <PostReply> tempList = await PageData.PManager.FBHelper.GetAllReplies();

            //List<PostReply> tempList = new List<PostReply>();
            int currentReplyId = tempList[tempList.Count - 1].Id + 1;

            //random title gen and post gen
            for (int i = 0; i < amount; i++)
            {
                lblUsers.Text += $"Adding reply: {i}\n";
                string randomPost = null;

                //generate post
                for (int k = 0; k < rnd.Next(10, 51); k++)
                {
                    randomPost += TESTER.randomWordsArray[rnd.Next(TESTER.randomWordsArray.Length)] + " ";
                }

                //PageData.PManager.PostRecords.Add(new Post(
                //    currentPostId,
                //    courseDb.records[rnd.Next(courseDb.records.Count)].ID,
                //    DateTime.Now.AddHours(rnd.Next(25) * -1).AddMinutes(rnd.Next(60) * -1).AddSeconds(rnd.Next(60) * 1),
                //    randomTitle,
                //    randomPost));

                //await PageData.PManager.FBHelper.firebase.Child("PostReply").Child(currentReplyId.ToString("0000")).PutAsync(new PostReply(
                //    currentReplyId,
                //    await GetRandomPostId(),
                //    DateTime.Now.AddHours(rnd.Next(25) * -1).AddMinutes(rnd.Next(60) * -1).AddSeconds(rnd.Next(60) * 1),
                //    randomPost));

                tempList.Add(new PostReply(currentReplyId,
                                           await TESTER.GetRandomPostId(),
                                           DateTime.Now.AddHours(rnd.Next(25) * -1).AddMinutes(rnd.Next(60) * -1).AddSeconds(rnd.Next(60) * 1),
                                           randomPost));


                ++currentReplyId;
            }

            foreach (PostReply item in tempList)
            {
                lblUsers.Text    += $"Adding votes to reply {item.Id}\n";
                item.Upvotes      = rnd.Next(501);
                item.Downvotes    = rnd.Next(501);
                item.UpvotesTxt   = $"Upvotes: {item.Upvotes}";
                item.DownvotesTxt = $"Downvotes: {item.Downvotes}";
            }

            lblUsers.Text += "****************** complete ******************";

            await PageData.PManager.FBHelper.firebase.Child("PostReply").PutAsync(tempList);
        }