public void Update_WithNullData_ThrowsException() { var bitAggregate = new BitAggregate(MockBitFactory.CreateEmptyMockBits(8)); Action action = () => { bitAggregate.Update(null); }; Assert.Throws <ArgumentNullException>(action); }
public void Update_WithInvalidData_ThrowsException(params int[] updateValues) { var bitAggregate = new BitAggregate(MockBitFactory.CreateEmptyMockBits(8)); Action action = () => { bitAggregate.Update(updateValues); }; Assert.Throws <ArgumentOutOfRangeException>(action); }
public void Update_WithValidData_MakesExpectedChanges(params int[] updateValues) { var bitAggregate = new BitAggregate(MockBitFactory.CreateEmptyMockBits(8)); bitAggregate.Update(updateValues); var bitValues = bitAggregate.Read(); Assert.Equal(bitValues, updateValues); }
public void Constructor_WithIncorrectNumberOfBits_ThrowsException(int bitCount) { Action action = () => { new Byte(MockBitFactory.CreateEmptyMockBits(bitCount)); }; Assert.Throws <ArgumentOutOfRangeException>(action); }
public void Constructor_WithExpectedNumberOfBits_ReturnsByte() { var b = new Byte(MockBitFactory.CreateEmptyMockBits(ByteMetadata.LengthInBits)); Assert.NotNull(b); }