Example #1
0
        public void TheTestSubjectsShallPopulateCorrectly()
        {
            const int trueIndex = 2;

            //Setup
            var testList = TestSubject.GetTestSubjects(trueIndex);

            //Exercise and assert
            for (int i = 0; i < testList.Count; i++)
            {
                Assert.IsTrue(testList[i].IsDefault == (trueIndex == i));
            }
            Assert.IsTrue(testList.IsValidDefaultList());
        }
Example #2
0
        public void SettingDefaultShallWork()
        {
            const int trueIndexInitial = 2;
            const int trueIndexFinal   = 3;

            //Setup
            var testList = TestSubject.GetTestSubjects(trueIndexInitial);

            //Exercise and assert
            var modified = testList.SetDefault(testList[trueIndexFinal]);

            for (int i = 0; i < testList.Count; i++)
            {
                Assert.IsTrue(testList[i].IsDefault == (trueIndexFinal == i));
            }

            Assert.IsTrue(testList.IsValidDefaultList());
            Assert.IsTrue(modified.Count == 2);
            Assert.IsTrue(modified.Contains(testList[trueIndexInitial]));
            Assert.IsTrue(modified.Contains(testList[trueIndexFinal]));
        }