public void GetFlag_999positionFalse_falseReturned() { IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(1000, true); mbf.ResetFlag(999); Assert.AreEqual(false, mbf.GetFlag()); }
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()); }
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); }
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); }
public void Test_CheckResetFlag_Error() { try{ IIG.BinaryFlag.MultipleBinaryFlag multiple_flag_obj = new IIG.BinaryFlag.MultipleBinaryFlag(2, true); multiple_flag_obj.ResetFlag(18000); } catch { Console.WriteLine("Specified argument was out of the range of valid values"); // Assert.Pass(); Assert.True(true); } }
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); }
public void FileWorker_Add_Get_FlagTrueChanged() { IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(10, true); mbf.ResetFlag(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 TestResetFlagExceedsLength() { try { IIG.BinaryFlag.MultipleBinaryFlag mbf = new IIG.BinaryFlag.MultipleBinaryFlag(20, false); mbf.ResetFlag(21); } catch (Exception e) { bool actual = e.Message.Contains("Position must be lesser than length"); Assert.True(actual); } }
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); }
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()); }