コード例 #1
0
        public void ChallengeTwo_TestSituation4()
        {
            string input  = "+7, +7, -2, -7, -4";
            int    result = DayOne.ComputeChallengeTwoResult(input);

            Assert.AreEqual(14, result);
        }
コード例 #2
0
        public void CallengeOne_TestSituation1()
        {
            string input  = "+1, +1, +1";
            int    result = DayOne.ComputeChallengeOneResult(input);

            Assert.AreEqual(3, result);
        }
コード例 #3
0
        public void ChallengeTwo_TestSituation3()
        {
            string input  = "-6, +3, +8, +5, -6";
            int    result = DayOne.ComputeChallengeTwoResult(input);

            Assert.AreEqual(5, result);
        }
コード例 #4
0
        public void testPartA_actual()
        {
            var sut    = new DayOne();
            var result = sut.PartA();

            Assert.Equal("1029", result);
        }
コード例 #5
0
        public void CallengeOne_TestSituation3()
        {
            string input  = "-1, -2, -3";
            int    result = DayOne.ComputeChallengeOneResult(input);

            Assert.AreEqual(-6, result);
        }
コード例 #6
0
        public void FindFirstDuplicateFrequency(string input, int expected)
        {
            var sut    = new DayOne();
            var result = sut.FindFirstDuplicateFrequency(input, 0);

            Assert.Equal(expected, result);
        }
コード例 #7
0
        public void TestPartTwo()
        {
            var expenses = GetExpensesFromFile();
            var product  = DayOne.GetListTriProduct(expenses, 2020);

            _output.WriteLine("Part Two Answer: {0}", product);
        }
コード例 #8
0
        public void testPartB_actual()
        {
            var sut    = new DayOne();
            var result = sut.PartB();

            Assert.Equal("1220", result);
        }
コード例 #9
0
        public void PartA_Actual()
        {
            var sut    = new DayOne();
            var result = sut.PartA();

            Assert.Equal("651651", result);
        }
コード例 #10
0
        public void testCircularInverseCaptcha(string input, int expected)
        {
            var sut    = new DayOne();
            var result = sut.CircularInverseCaptcha(input);

            Assert.Equal(expected, result);
        }
コード例 #11
0
        public void ChallengeTwo_TestSituation1()
        {
            string input  = "+1, -1";
            int    result = DayOne.ComputeChallengeTwoResult(input);

            Assert.AreEqual(0, result);
        }
コード例 #12
0
        public void PartB_Actual()
        {
            var sut    = new DayOne();
            var result = sut.PartB();

            Assert.Equal("214486272", result);
        }
コード例 #13
0
        public void testInverseCaptchaViaSum(string input, int expected)
        {
            var sut    = new DayOne();
            var result = sut.InverseCaptchaViaSum(input);

            Assert.Equal(expected, result);
        }
コード例 #14
0
        public void testDetermineFirstRepeatLocation()
        {
            var sot    = new DayOne();
            var result = sot.DetermineFirstRepeatLocation("R8, R4, R4, R10");

            Assert.Equal(4, result);
        }
コード例 #15
0
        public void testDetermineDistanceTraveled(int expected, string input)
        {
            var sot    = new DayOne();
            var result = sot.DetermineDistanceTraveled(input);

            Assert.Equal(expected, result);
        }
コード例 #16
0
        protected async Task ShowResults()
        {
            if (ValidateTextbox())
            {
                invalid = false;
                DayOne _challengeSolver = new DayOne(sumNumber);

                _partOne = new ValidEntries();
                _partTwo = new ValidEntries();

                await RefreshReport();

                if (_expenseReport.Count > 0)
                {
                    _partOne = _challengeSolver.PartOne(_expenseReport);
                    _partTwo = _challengeSolver.PartTwo(_expenseReport);
                }

                if (_partOne != null && _partTwo != null)
                {
                    childOne.Show();
                    childTwo.Show();
                }
                else
                {
                    invalid = true;
                }
            }
            else
            {
                invalid = true;
            }
        }
コード例 #17
0
        public void testWithActualPartA()
        {
            var sot    = new DayOne();
            var result = sot.DetermineDistanceTraveled(DayOne.PUZZLE_INPUT);

            Assert.Equal(273, result);
        }
コード例 #18
0
        public void testWithActualPartB()
        {
            var sot    = new DayOne();
            var result = sot.DetermineFirstRepeatLocation(DayOne.PUZZLE_INPUT);

            Assert.Equal(115, result);
        }
コード例 #19
0
        public void ChangeFrequency(string input, int expected)
        {
            var sut    = new DayOne();
            var result = sut.ChangeFrequency(input, 0);

            Assert.Equal(expected, result);
        }
コード例 #20
0
ファイル: App.cs プロジェクト: nabhishek/AzureEventApp2015
        //public static IDataStore DataStore { get; set; }

        //public static Color NavTint
        //{
        //    get { return AppSettings.ColorMainApp; }
        //}

        //public static Color HeaderTint
        //{
        //    get { return AppSettings.ColorMainApp; }
        //}

        //public static IDataStore Initialize(IDataCache cache, INetworkMonitor networkMonitor)
        //{
        //    return DataStore = new JsonDataStore(cache, AppSettings.Log, networkMonitor);
        //}
        public App()
        {
            //var CurrentDate = DateTime.Now.Date;
            DayOne = DateTime.Parse(DayOneString);
            DayOne = DayOne.Date;
            var dayTwo      = DayOne.AddDays(1).Date;
            var currentDate = DateTime.Now.Date;

            if (currentDate < DayOne)
            {
                CurrentDayType = DayTypes.Unknown;
            }
            else if (currentDate == DayOne)
            {
                CurrentDayType = DayTypes.Day1;
            }
            else if (currentDate == dayTwo)
            {
                CurrentDayType = DayTypes.Day2;
            }
            else
            {
                CurrentDayType = DayTypes.Unknown;
            }
            MainPage = GetMainPage();
        }
コード例 #21
0
        public void BasicCasesPass()
        {
            var dayOne = new DayOne();

            Assert.AreEqual(dayOne.Solve("12"), 2m);
            Assert.AreEqual(dayOne.Solve("14"), 2m);
            Assert.AreEqual(dayOne.Solve("1969"), 654m);
        }
コード例 #22
0
        public void Test4()
        {
            const int Expected = 5;

            var input  = new[] { -6, +3, +8, +5, -6 };
            var actual = DayOne.FirstDuplicate(input);

            Assert.Equal(Expected, actual);
        }
コード例 #23
0
        public void Test3()
        {
            const int Expected = 0;

            var input  = new[] { +1, +1, -2 };
            var actual = DayOne.Calibrate(input);

            Assert.Equal(Expected, actual);
        }
コード例 #24
0
        public void Test5()
        {
            const int Expected = 14;

            var input  = new[] { +7, +7, -2, -7, -4 };
            var actual = DayOne.FirstDuplicate(input);

            Assert.Equal(Expected, actual);
        }
コード例 #25
0
        public void Test4()
        {
            const int Expected = -6;

            var input  = new[] { -1, -2, -3 };
            var actual = DayOne.Calibrate(input);

            Assert.Equal(Expected, actual);
        }
コード例 #26
0
        public void Solution()
        {
            const int Expected = 561;

            var input  = Resources.InputD1P1.Split(Environment.NewLine).Select(int.Parse).ToArray();
            var actual = DayOne.Calibrate(input);

            Assert.Equal(Expected, actual);
        }
コード例 #27
0
        public void Test2()
        {
            const int Expected = 0;

            var input  = new[] { +1, -1 };
            var actual = DayOne.FirstDuplicate(input);

            Assert.Equal(Expected, actual);
        }
コード例 #28
0
        public void FindReportSumTwo()
        {
            var input = new List <int>()
            {
                1721,
                979,
                366,
                299,
                675,
                1456
            };

            var sut    = new DayOne();
            var result = sut.FindReportSumTwo(input);

            Assert.Equal(514579, result);
        }
コード例 #29
0
        static void Main()
        {
            DayOne.TaskOne();
            DayOne.TaskTwo();

            DayTwo.TaskOne();
            DayTwo.TaskTwo();

            DayThree.TaskOne();
            DayThree.TaskTwo();

            DayFour.TaskOne();
            DayFour.TaskTwo();

            DaySix.TaskOne();
            DaySix.TaskTwo();

            Console.Read();
        }
コード例 #30
0
        public void PartTwo()
        {
            var dayOne = new DayOne();

            var output = dayOne.PartTwo(inputFile);
        }