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()); }
public void Test_CheckGetFlagMethod_False_Case2() // set all flag except zero index value true { IIG.BinaryFlag.MultipleBinaryFlag multiple_flag_obj = new IIG.BinaryFlag.MultipleBinaryFlag(3, false); multiple_flag_obj.SetFlag(0); multiple_flag_obj.SetFlag(1); Assert.False(multiple_flag_obj.GetFlag()); }
public void GetFlag_01_falseReturned() { IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(2, false); mbf.SetFlag(1); Assert.AreEqual(false, mbf.GetFlag()); }
public void GetFlag_0positionTrue_falseReturned() { IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(1000, false); mbf.SetFlag(0); Assert.AreEqual(false, mbf.GetFlag()); }
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()); }
public void SetFlagExceeedsLength() { bool expected = true; IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(100, false); mbf.SetFlag(999999); bool actual = mbf.GetFlag(); Assert.Equal(expected, actual); }
public void Test_CheckSetValue_Error_Case1() { IIG.BinaryFlag.MultipleBinaryFlag multiple_flag_obj = new IIG.BinaryFlag.MultipleBinaryFlag(2, false); try { multiple_flag_obj.SetFlag(2); } catch { Console.WriteLine("Specified argument was out of the range of valid values"); // Assert.Pass(); Assert.True(true); } }
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()); }
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); }
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); }
public void TestSetFlagReturnFalse() { IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(20, false); for (ulong i = 0; i < 10; i++) { mbf.SetFlag(i); } bool actual = mbf.GetFlag(); Assert.False(actual); }
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); }
public void CheckForEqualityAlmostSameBigger() { bool expected = false; IIG.BinaryFlag.MultipleBinaryFlag mbf1 = new IIG.BinaryFlag.MultipleBinaryFlag(50000, false); IIG.BinaryFlag.MultipleBinaryFlag mbf2 = new IIG.BinaryFlag.MultipleBinaryFlag(50000, false); mbf1.SetFlag(1489); bool actual = mbf1.Equals(mbf2); Assert.Equal(expected, actual); }
public void FileWorker_Add_Get_FlagFalseChanged() { IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(10, false); mbf.SetFlag(2); 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); }
public void TestSetFlagExceedsLength() { try { IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(20, false); mbf.SetFlag(21); } catch (Exception e) { bool actual = e.Message.Contains("Position must be lesser than length"); Assert.True(actual); } }
public void SetFlagReturnsTrue() { bool expected = true; IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(100, false); for (ulong i = 0; i < 100; i++) { mbf.SetFlag(i); } bool actual = mbf.GetFlag(); Assert.Equal(expected, actual); }
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); }
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); }
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()); }