Exemple #1
0
        public void InsertValueTest()
        {
            var actual = new FieldsContainer();

            for (int i = 0; i < 9; i++)
            {
                actual.Fields.Add(new Field());
            }

            actual.InsertValue(1, 1);
            actual.InsertValue(5, 5);

            Assert.AreEqual(1, actual.Fields[1].Value);
            Assert.AreEqual(5, actual.Fields[5].Value);
        }
Exemple #2
0
        public void ToStringTest()
        {
            var actual = new FieldsContainer();

            for (int i = 0; i < 9; i++)
            {
                actual.Fields.Add(new Field());
            }
            var expected = "|1|0|3|0|0|0|0|0|9|";


            actual.InsertValue(0, 1);
            actual.InsertValue(2, 3);
            actual.InsertValue(8, 9);

            Assert.AreEqual(expected, actual.ToString());
        }
Exemple #3
0
        public void CleerValuesBySetTest()
        {
            var actual = new FieldsContainer();

            for (int i = 0; i < 9; i++)
            {
                new Field().AddContainer(actual);
            }
            var expected = new List <int>()
            {
                1, 2, 4, 5, 7, 8, 9
            };

            actual.InsertValue(0, 3);
            actual.InsertValue(1, 6);

            CollectionAssert.AreEqual(expected, actual.ValueToSet);
            CollectionAssert.AreEqual(expected, actual.Fields[2].PossibleValues);
        }
Exemple #4
0
        public void ComplitedContainerTest()
        {
            var actual = new FieldsContainer();

            for (int i = 0; i < 9; i++)
            {
                actual.Fields.Add(new Field());
            }

            for (int i = 0; i < 9; i++)
            {
                actual.InsertValue(i, i + 1);
            }

            Assert.IsTrue(actual.IsDone);
        }