Exemplo n.º 1
0
        public static async Task ShouldNotAddNode <TNode>(this IMixerViewModel mixer,
                                                          IInteractionService interactions,
                                                          INodeFactory nodeFactory,
                                                          Func <IMixerViewModel, Task> command)
            where TNode : INode
        {
            // Arrange

            var isInvoked = false;

            interactions.GetNewNodePoint
            .RegisterHandler(i =>
            {
                isInvoked = true;
                i.SetOutput(null);
            });
            // Act

            mixer.Activator
            .Activate();

            await command(mixer);

            // Assert

            isInvoked.Should().BeTrue();

            nodeFactory.DidNotReceive().Create <TNode>();

            mixer.Nodes.IsEmpty.Should().BeTrue();
        }