public void Read_InitializedObject_ReturnsExpectedValue(params int[] initValues) { var bits = MockBitFactory.CreateMockBits(initValues); var bitAggregate = new BitAggregate(bits); var bitValues = bitAggregate.Read(); Assert.Equal(bitValues, initValues); }
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 Clear_ZeroesAllBits() { var bitAggregate = new BitAggregate(MockBitFactory.CreateMockBits(0, 1, 0, 0, 1, 1, 0, 0)); bitAggregate.Clear(); var bitValues = bitAggregate.Read(); Assert.Equal(bitValues, ListFactory.CreateList(0, 0, 0, 0, 0, 0, 0, 0)); }
public void ShiftRight_PerformsAsExpected(int lowestBitValue) { var bitAggregate = new BitAggregate(MockBitFactory.CreateMockBits(lowestBitValue, 0, 1, 0, 1, 0, 1, 0)); int carryFlagValue = bitAggregate.ShiftRight(); var bitValues = bitAggregate.Read(); Assert.Equal(bitValues, ListFactory.CreateList(0, 1, 0, 1, 0, 1, 0, 0)); Assert.Equal(lowestBitValue, carryFlagValue); }