Ejemplo n.º 1
0
            public void ParsesAndWorks()
            {
                var subject = new Day3Solution.Part1();

                subject.Solve(new List <string>
                {
                    "#1 @ 1,3: 4x4",
                    "#2 @ 3,1: 4x4",
                }).Should().Be(4);
            }
Ejemplo n.º 2
0
            public void MakesTheGrid()
            {
                var subject = new Day3Solution.Part1();

                subject.gridSize = 2;
                subject.MakeGrid(new List <Day3Solution.Claim>
                {
                    new Day3Solution.Claim()
                    {
                        Id     = 1,
                        Left   = 1,
                        Top    = 0,
                        Width  = 1,
                        Height = 1
                    },
                    new Day3Solution.Claim()
                    {
                        Id     = 2,
                        Left   = 1,
                        Top    = 0,
                        Width  = 1,
                        Height = 1
                    },
                    new Day3Solution.Claim()
                    {
                        Id     = 3,
                        Left   = 0,
                        Top    = 1,
                        Width  = 1,
                        Height = 1
                    }
                }).Should().BeEquivalentTo(new List <int>[, ]
                {
                    { new List <int>(), new List <int> {
                          1, 2
                      } },
                    { new List <int> {
                          3
                      }, new List <int>() },
                });
            }
Ejemplo n.º 3
0
            public void Works()
            {
                var subject = new Day3Solution.Part1();

                subject.Solve(new List <Day3Solution.Claim>
                {
                    new Day3Solution.Claim()
                    {
                        Id     = 1,
                        Left   = 1,
                        Top    = 3,
                        Width  = 4,
                        Height = 4
                    },
                    new Day3Solution.Claim()
                    {
                        Id     = 2,
                        Left   = 3,
                        Top    = 1,
                        Width  = 4,
                        Height = 4
                    }
                }).Should().Be(4);
            }