public void Values_are_added() { var sut = new Interactors(new Calculator(new Protokoll(), new ValueProvider())); var result = sut.Add(new AddVM { X = "1", Y = "2" }); Assert.That(result.Sum, Is.EqualTo("45")); }
public void Values_are_added() { var sut = new Interactors(); var result = sut.Add(new AddVM { X = "1", Y = "2" }); Assert.That(result.Sum, Is.EqualTo("45")); }
public void InteractWith(Actor other_actor) { if (Interactors.Contains(other_actor)) { return; // this should prevent infinite recursion } Interactors.Clear(); // in future, interact with player first, then an npc Interactors.Add(other_actor); other_actor.Interactions.InteractWith(Actor); }
public void Protocol_is_written_to_console() { using (var consoleUi = new ConsoleUi()) { var sut = new Interactors(new Calculator(new Protokoll(), new ValueProvider())); sut.Add(new AddVM { X = "1", Y = "2" }); Assert.That(consoleUi.Output(), Is.EqualTo(new[] { "x = 1, y = 2, z = 42, sum = 45", "" })); } }
public void Copy(InteractionObject _object) { if (_object == null) { return; } base.Copy(_object); Interactors.Clear(); foreach (InteractorObject _interactor in _object.Interactors) { Interactors.Add(new InteractorObject(_interactor)); } }