public void AcceptCallsVisitor() { var sut = new TaskComposite(arbitraryName); var visitorStub = new Mock <ITaskVisitor>(); sut.Accept(visitorStub.Object); visitorStub.Verify(v => v.Visit(sut)); }
public void ValueIsCorrect(decimal value1, decimal value2, decimal value3) { var expected = value1 + value2 + value3; var e1 = new TaskElement(arbitraryName, value1); var e2 = new TaskElement(arbitraryName, value2); var e3 = new TaskElement(arbitraryName, value3); var c1 = new TaskComposite(arbitraryName, components: new List <ITaskComponent> { e2, e3 }); var rootComposite = new TaskComposite(arbitraryName, components: new List <ITaskComponent> { e1, c1 }); var sut = new ValueTaskVisitor(); rootComposite.Accept(sut); Assert.Equal(expected, sut.Value); }