Beispiel #1
0
        public async Task <PositionProjection> RemovePosition(Guid id)
        {
            var command = new RemovePositionCommand(id);
            var result  = await _commandDispatcher.Execute(command);

            return(result);
        }
Beispiel #2
0
        public void WhenLengthSet_ThenSet(int position, int length, string expected)
        {
            var sut = new RemovePositionCommand(position, length).SetValue(Value);

            sut.Execute();

            Assert.That(sut.Result, Is.EqualTo(expected));
        }
Beispiel #3
0
        public void WhenValueIsNullOrEmpty_ThenSetSame(string value)
        {
            var sut = new RemovePositionCommand(0, 1).SetValue(value);

            sut.Execute();

            Assert.That(sut.Result, Is.EqualTo(value));
        }
Beispiel #4
0
        public async void given_remove_position_command_command_dispatcher_should_get_same_command_created_in_controller()
        {
            var mockAgg = new PositionControllerMockAggregate();

            var controller = mockAgg.PositionControllerFactory();

            var input = new Guid();

            var command = new RemovePositionCommand(input);

            mockAgg.setup_dispatcher_to_verify_removePositionCommands_are_the_same(input);

            var result = await controller.RemovePosition(input);

            //Assert
            Assert.IsType <PositionProjection>(result);
            Assert.Equal(result.Id, input);
        }