示例#1
0
        public void FileWorker_Add_Get_FlagTrue()
        {
            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(2, true);

            IIG.FileWorker.BaseFileWorker.Write(mbf.GetFlag().ToString(), @"C:\Users\user\Desktop\Навчання\4 курс\7 семестр\КПІ-3\l4\l4\UnitTestL4\TextFile.txt");

            string expected = mbf.GetFlag().ToString();
            string actual   = IIG.FileWorker.BaseFileWorker.ReadAll(@"C:\Users\user\Desktop\Навчання\4 курс\7 семестр\КПІ-3\l4\l4\UnitTestL4\TextFile.txt");

            Assert.AreEqual(expected, actual);
        }
示例#2
0
 public void Test_CheckGetFlagMethod_False_Case3()
 // set zero index value true
 {
     IIG.BinaryFlag.MultipleBinaryFlag multiple_flag_obj = new IIG.BinaryFlag.MultipleBinaryFlag(3, false);
     multiple_flag_obj.SetFlag(0);
     Assert.False(multiple_flag_obj.GetFlag());
 }
示例#3
0
        public void TestConstructorTrue()
        {
            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(2);
            bool actual = mbf.GetFlag();

            Assert.True(actual);
        }
示例#4
0
        public void GetFlag_999positionFalse_falseReturned()
        {
            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(1000, true);

            mbf.ResetFlag(999);

            Assert.AreEqual(false, mbf.GetFlag());
        }
示例#5
0
        public void GetFlag_0positionTrue_falseReturned()
        {
            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(1000, false);

            mbf.SetFlag(0);

            Assert.AreEqual(false, mbf.GetFlag());
        }
示例#6
0
        public void GetFlag_01_falseReturned()
        {
            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(2, false);

            mbf.SetFlag(1);

            Assert.AreEqual(false, mbf.GetFlag());
        }
示例#7
0
 public void Test_CheckSetValue_True()
 // all flags were true and after SetFlag metod stay true.
 {
     IIG.BinaryFlag.MultipleBinaryFlag multiple_flag_obj = new IIG.BinaryFlag.MultipleBinaryFlag(2, true);
     multiple_flag_obj.SetFlag(0);
     multiple_flag_obj.SetFlag(1);
     Assert.True(multiple_flag_obj.GetFlag());
 }
示例#8
0
        public void ConstructorExceedMaxLength()
        {
            bool expected = false;

            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(9999999999999999999, false);
            bool actual = mbf.GetFlag();

            Assert.Equal(expected, actual);
        }
示例#9
0
        public void ConstructorNormalRun()
        {
            bool expected = false;

            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(2, false);
            bool actual = mbf.GetFlag();

            Assert.Equal(expected, actual);
        }
示例#10
0
        public void SetFlag_1_999_trueReturned()
        {
            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(999, false);
            for (ulong i = 0; i < 999; i++)
            {
                mbf.SetFlag(i);
            }

            Assert.AreEqual(true, mbf.GetFlag());
        }
示例#11
0
        public void ResetFlag_10_99_falseReturned()
        {
            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(99, true);
            for (ulong i = 9; i < 99; i++)
            {
                mbf.ResetFlag(i);
            }

            Assert.AreEqual(false, mbf.GetFlag());
        }
示例#12
0
        public void ResetFlagExceedsLength()
        {
            bool expected = true;

            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(3, false);
            mbf.ResetFlag(999999);
            bool actual = mbf.GetFlag();

            Assert.Equal(expected, actual);
        }
示例#13
0
        public void GetFlagReturnsFalse()
        {
            bool expected = false;

            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(2, false);
            mbf.SetFlag(1);

            bool actual = mbf.GetFlag();

            Assert.Equal(expected, actual);
        }
示例#14
0
        public void Despose()
        {
            bool expected = true;

            IIG.BinaryFlag.MultipleBinaryFlag mbf1 = new IIG.BinaryFlag.MultipleBinaryFlag(2, true);
            mbf1.Dispose();

            bool actual = mbf1.GetFlag();

            Assert.NotEqual(expected, actual);
        }
示例#15
0
        public void CheckOnlyOneSetFlagOnWholeLength()
        {
            bool expected = false;

            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(1000, false);
            mbf.SetFlag(0);

            bool actual = mbf.GetFlag();

            Assert.Equal(expected, actual);
        }
示例#16
0
        public void OneResetFlagReturnToAllFlagsFalse()
        {
            bool expected = false;

            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(1000, true);
            mbf.ResetFlag(999);

            bool actual = mbf.GetFlag();

            Assert.Equal(expected, actual);
        }
示例#17
0
        public void GetFlagWithOnlyOneSetFlagReturnFalse()
        {
            bool expected = false;

            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(1000, false);
            mbf.SetFlag(300);

            bool actual = mbf.GetFlag();

            Assert.Equal(expected, actual);
        }
示例#18
0
        public void TestResetFlagReturnFalse()
        {
            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(20, true);
            for (ulong i = 0; i < 20; i++)
            {
                mbf.ResetFlag(i);
            }
            bool actual = mbf.GetFlag();

            Assert.False(actual);
        }
示例#19
0
        public void TestSetFlagReturnTrue()
        {
            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(20, false);
            for (ulong i = 0; i < 20; i++)
            {
                mbf.SetFlag(i);
            }
            bool actual = mbf.GetFlag();

            Assert.True(actual);
        }
示例#20
0
        public void GetFlag_0positionFalse_falseReturned()
        {
            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(1000, false);

            for (ulong i = 1; i < 1000; i++)
            {
                mbf.SetFlag(i);
            }

            Assert.AreEqual(false, mbf.GetFlag());
        }
示例#21
0
        public void ResetFlagReturnsFalse()
        {
            bool expected = false;

            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(100, false);
            for (ulong i = 0; i < 100; i++)
            {
                mbf.ResetFlag(i);
            }
            bool actual = mbf.GetFlag();

            Assert.Equal(expected, actual);
        }
示例#22
0
        public void GetFlagRerunsFalseFromStart()
        {
            bool expected = false;

            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(1000, false);
            for (ulong i = 1; i < 1000; i++)
            {
                mbf.SetFlag(i);
            }

            bool actual = mbf.GetFlag();

            Assert.Equal(expected, actual);
        }
示例#23
0
        public void SetFlagExceedsLength()
        {
            bool expected = false;

            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(99, false);
            for (ulong i = 10; i < 999; i++)
            {
                mbf.SetFlag(i);
            }

            bool actual = mbf.GetFlag();

            Assert.Equal(expected, actual);
        }
示例#24
0
 public void Test_CheckGetFlagMethod_False_Case1()
 {
     IIG.BinaryFlag.MultipleBinaryFlag multiple_flag_obj = new IIG.BinaryFlag.MultipleBinaryFlag(2, false);
     Assert.False(multiple_flag_obj.GetFlag());
 }
示例#25
0
        public void Constructor_ulongMaxLength_falseReturned()
        {
            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(4294967295, false);

            Assert.AreEqual(false, mbf.GetFlag());
        }
示例#26
0
 public void Test_CheckResetMethod_False()
 {
     IIG.BinaryFlag.MultipleBinaryFlag multiple_flag_obj = new IIG.BinaryFlag.MultipleBinaryFlag(2, true);
     multiple_flag_obj.ResetFlag(0);
     Assert.False(multiple_flag_obj.GetFlag());
 }
示例#27
0
 public void Test_CheckToStringMethod_False()
 {
     IIG.BinaryFlag.MultipleBinaryFlag multiple_flag_obj = new IIG.BinaryFlag.MultipleBinaryFlag(2, false);
     Assert.Equal("False", multiple_flag_obj.GetFlag().ToString());
 }
示例#28
0
        public void GetFlag_trueReturned()
        {
            IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(2, true);

            Assert.AreEqual(true, mbf.GetFlag());
        }
示例#29
0
 public void Test_CheckGetFlagMethod_True()
 {
     IIG.BinaryFlag.MultipleBinaryFlag multiple_flag_obj = new IIG.BinaryFlag.MultipleBinaryFlag(2, true);
     Assert.True(multiple_flag_obj.GetFlag());
 }
示例#30
0
 public void Test_CheckSetValue_False_Case2()
 {
     IIG.BinaryFlag.MultipleBinaryFlag multiple_flag_obj = new IIG.BinaryFlag.MultipleBinaryFlag(2, false);
     multiple_flag_obj.SetFlag(0);
     Assert.False(multiple_flag_obj.GetFlag());
 }