public static void Record_CellOpExecutionEventBase___Should_add_operationExecutionEvent_to_the_end_of_OperationExecutionEvents___When_OperationExecutionEvents_is_null()
        {
            // Arrange
            var systemUnderTest = A.Dummy <OperationCell <Version> >().DeepCloneWithOperationExecutionEvents(null);

            var operationExecutionEvent = A.Dummy <CellOpExecutionEventBase>();

            IReadOnlyList <CellOpExecutionEventBase> expected = new CellOpExecutionEventBase[]
            {
                operationExecutionEvent,
            }
            .ToList();

            // Act
            systemUnderTest.Record(operationExecutionEvent);

            // Assert
            systemUnderTest.OperationExecutionEvents.Must().BeEqualTo(expected);
        }
コード例 #2
0
        public static void GetCellOpExecutionStatus___Should_return_CellOpExecutionStatus_Completed___When_last_event_in_OperationExecutionEvents_is_CellOpExecutionCompletedEvent()
        {
            // Arrange
            var events = new CellOpExecutionEventBase[0]
                         .Concat(Some.ReadOnlyDummies <CellOpExecutionEventBase>())
                         .Concat(new[]
            {
                A.Dummy <CellOpExecutionCompletedEvent <Version> >(),
            })
                         .ToList();

            var cell = A.Dummy <OperationCell <Version> >().DeepCloneWithOperationExecutionEvents(events);

            // Act
            var actual = cell.GetCellOpExecutionStatus();

            // Assert
            actual.AsTest().Must().BeEqualTo(CellOpExecutionStatus.Completed);
        }
        public static void ClearCellValue___Should_add_CellOpExecutionClearedEvent_to_the_end_of_OperationExecutionEvents___When_OperationExecutionEvents_is_null()
        {
            // Arrange
            var systemUnderTest = A.Dummy <OperationCell <Version> >().DeepCloneWithOperationExecutionEvents(null);

            var timestampUtc = A.Dummy <UtcDateTime>();

            var details = A.Dummy <string>();

            IReadOnlyList <CellOpExecutionEventBase> expected = new CellOpExecutionEventBase[]
            {
                new CellOpExecutionClearedEvent(timestampUtc, details),
            }
            .ToList();

            // Act
            systemUnderTest.ClearCellValue(timestampUtc, details);

            // Assert
            systemUnderTest.OperationExecutionEvents.Must().BeEqualTo(expected);
        }