Exemplo n.º 1
0
        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"));
        }
Exemplo n.º 2
0
        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"));
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 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));
            }
        }
Exemplo n.º 6
0
        public void Setup()
        {
            var firstCall = true;

            _sut = new Interactors(
                () => "1234",
                () => "A1B2C3",
                () => {
                if (firstCall)
                {
                    firstCall = false;
                    return(new DateTime(2019, 9, 26, 12, 0, 0));
                }
                return(new DateTime(2019, 9, 26, 12, 5, 0));
            });
        }
Exemplo n.º 7
0
        public RegisterModule(Interactors interactors)
        {
            Get("/register", context => {
                var name   = Request.Query["name"];
                var phone  = Request.Query["phone"];
                var result = interactors.Register(name, phone);
                var json   = FormatterExtensions.AsJson <Result>(Response, result);
                return(json);
            });

            Get("/approve/{id}", context => {
                var id     = context.id;
                var code   = Request.Query["code"];
                var result = interactors.Approve(code, id);
                var json   = FormatterExtensions.AsJson <Result>(Response, result);
                return(json);
            });
        }
Exemplo n.º 8
0
        public RollerModule(Interactors interactors)
        {
            Get("/checkin/{id}", context => {
                var id       = context.id;
                var rollerId = Request.Query["rollerid"];
                var result   = interactors.Checkin(id, rollerId);
                var json     = FormatterExtensions.AsJson <Result>(Response, result);
                return(json);
            });

            Get("/checkout/{id}", context => {
                var id       = context.id;
                var rollerId = Request.Query["rollerid"];
                var result   = interactors.Checkout(id, rollerId);
                var json     = FormatterExtensions.AsJson <Result>(Response, result);
                return(json);
            });
        }
Exemplo n.º 9
0
 public void AssignWho(Interactors i)
 {
     who = i;
 }
 public void AssignWho(Interactors i)
 {
     //Debug.Log("Assigning a new interactor");
     who = i;
 }