Ejemplo n.º 1
0
        public void PuzzleSet_Clear_Test1()
        {
            foreach (var size in new[]
            {
                PuzzleSize.FourByFour,
                PuzzleSize.NineByNine,
                PuzzleSize.SixteenBySixteen
            })
            {
                var sut = new PuzzleSet(size);

                Assert.True(sut.AddRange(Enumerable.Range(1, sut.MaxValue).Select(Convert.ToByte)));
                Assert.NotEmpty(sut);
                Assert.Equal(sut.MaxValue, sut.Count);

                sut.Clear();
                Assert.Empty(sut);
            }
        }
Ejemplo n.º 2
0
        public void PuzzleSet_Contains_Test1()
        {
            foreach (var size in new[]
            {
                PuzzleSize.FourByFour,
                PuzzleSize.NineByNine,
                PuzzleSize.SixteenBySixteen
            })
            {
                var sut = new PuzzleSet(size);
                foreach (var value in Enumerable.Range(1, sut.MaxValue).Select(Convert.ToByte))
                {
                    Assert.True(sut.Add(value));
                    Assert.Contains(value, sut);

                    sut.Clear();
                    Assert.DoesNotContain(value, sut);
                }
            }
        }