public static void SetCellValue_object___Should_add_CellInputAppliedEvent_to_the_end_of_InputEvents___When_InputEvents_is_not_empty() { // Arrange var systemUnderTest = A.Dummy <InputCell <Version> >(); var timestampUtc = A.Dummy <UtcDateTime>(); var details = A.Dummy <string>(); var version = A.Dummy <Version>(); IReadOnlyList <CellInputEventBase> expected = new CellInputEventBase[0] .Concat(systemUnderTest.InputEvents) .Concat(new[] { new CellInputAppliedEvent <Version>(timestampUtc, version, details), }) .ToList(); // Act systemUnderTest.SetCellValue(version, timestampUtc, details); // Assert systemUnderTest.InputEvents.Must().BeEqualTo(expected); }
public static void Record_CellInputEventBase___Should_add_inputEvent_to_the_end_of_InputEvents___When_InputEvents_is_null() { // Arrange var systemUnderTest = A.Dummy <InputCell <Version> >().DeepCloneWithInputEvents(null); var inputEvent = A.Dummy <CellInputEventBase>(); IReadOnlyList <CellInputEventBase> expected = new CellInputEventBase[] { inputEvent, } .ToList(); // Act systemUnderTest.Record(inputEvent); // Assert systemUnderTest.InputEvents.Must().BeEqualTo(expected); }
public static void Record_CellInputEventBase___Should_add_inputEvent_to_the_end_of_InputEvents___When_InputEvents_is_not_empty() { // Arrange var systemUnderTest = A.Dummy <InputCell <Version> >(); var inputEvent = A.Dummy <CellInputEventBase>(); IReadOnlyList <CellInputEventBase> expected = new CellInputEventBase[0] .Concat(systemUnderTest.InputEvents) .Concat(new[] { inputEvent, }) .ToList(); // Act systemUnderTest.Record(inputEvent); // Assert systemUnderTest.InputEvents.Must().BeEqualTo(expected); }
public static void SetCellValue_object___Should_add_CellInputAppliedEvent_to_the_end_of_InputEvents___When_value_is_null() { // Arrange var systemUnderTest = A.Dummy <InputCell <Version> >().DeepCloneWithInputEvents(null); var timestampUtc = A.Dummy <UtcDateTime>(); var details = A.Dummy <string>(); IReadOnlyList <CellInputEventBase> expected = new CellInputEventBase[] { new CellInputAppliedEvent <Version>(timestampUtc, null, details), } .ToList(); // Act systemUnderTest.SetCellValue(null, timestampUtc, details); // Assert systemUnderTest.InputEvents.Must().BeEqualTo(expected); }