Esempio n. 1
0
        public void Day03_MarkUpCloth_Part2_answer()
        {
            string datapath = "day03a.txt";
            var    sut      = new Day03ClaimChecker();

            List <Claim> claims = sut.ParseData(datapath);

            Assert.NotNull(claims);
            Assert.Equal(1385, claims.Count);
            int[,] cloth = new int[1000, 1000];

            sut.MarkupCloth(cloth, claims);
            int expected = 116491;
            int actual   = sut.OverlappingInches(cloth, 1000, 1000);

            Assert.Equal(expected, actual);
            string claimExpected = "#707";
            string claimActual   = string.Empty;


            foreach (var claim in claims)
            {
                if (!sut.DoesClaimOverlap(cloth, claim))
                {
                    claimActual = claim.ClaimId;
                }
            }
            Assert.Equal(claimExpected, claimActual);
        }
Esempio n. 2
0
        public void Day03_MarkUpCloth_Part1_answer()
        {
            string datapath = "day03a.txt";
            var    sut      = new Day03ClaimChecker();

            List <Claim> claims = sut.ParseData(datapath);

            Assert.NotNull(claims);
            Assert.Equal(1385, claims.Count);
            int[,] cloth = new int[1000, 1000];

            sut.MarkupCloth(cloth, claims);
            int expected = 116491;
            int actual   = sut.OverlappingInches(cloth, 1000, 1000);

            Assert.Equal(expected, actual);
        }