public void SetValueString_ThrowsOperationCanceledException_InputLengthIsIncorrect() { // Arrange var bitset = new IntegerBitset(); // Act void Result() => bitset.SetValue("10110101"); // Assert Assert.Throws <OperationCanceledException>(Result); }
public void SetValueString_ThrowsArgumentNullException_InputIsNull() { // Arrange var bitset = new IntegerBitset(); // Act void Result() => bitset.SetValue((string)null); // Assert Assert.Throws <ArgumentNullException>(Result); }
public void SetValueBitArray_ThrowsOperationCanceledException_InputLengthIsIncorrect() { // Arrange var bitset = new IntegerBitset(); // Act void Result() => bitset.SetValue(new BitArray(new byte[] { 7 })); // Assert Assert.Throws <OperationCanceledException>(Result); }
public void SetValueString_Passes_InputIsCorrect() { // Arrange var bitset = new IntegerBitset(); // Act bitset.SetValue("00000000000000000000000000000111"); // Assert Assert.Equal(7, bitset.GetInt32()); }
public void SetValueBitArray_Passes_InputIsCorrect() { // Arrange var bitset = new IntegerBitset(); // Act bitset.SetValue(new BitArray(new [] { 8 })); // Assert Assert.Equal(8, bitset.GetInt32()); }