コード例 #1
0
ファイル: EventTests.cs プロジェクト: plcode7/Itc4net
        public void MatchShouldInvokeNodeFuncWhenEventRepresentsNode()
        {
            // Arrange
            Event e = new Event.Node(0, 1, 2);

            Func <int, object> leafFn = Substitute.For <Func <int, object> >();
            Func <int, Event, Event, object> nodeFn = Substitute.For <Func <int, Event, Event, object> >();

            // Act
            e.Match(leafFn, nodeFn);

            // Assert
            leafFn.DidNotReceiveWithAnyArgs();
            nodeFn.Received().Invoke(0, 1, 2);
        }
コード例 #2
0
ファイル: EventTests.cs プロジェクト: plcode7/Itc4net
        public void MatchShouldInvokeNodeActionWhenEventRepresentsNode()
        {
            // Arrange
            Event e = new Event.Node(0, 1, 2);

            Action <int> leafAction = Substitute.For <Action <int> >();
            Action <int, Event, Event> nodeAction = Substitute.For <Action <int, Event, Event> >();

            // Act
            e.Match(leafAction, nodeAction);

            // Assert
            leafAction.DidNotReceiveWithAnyArgs();
            nodeAction.Received().Invoke(0, 1, 2);
        }