Beispiel #1
0
        public async Task Edit()
        {
            var Solution = await this.Add();

            var message = new HttpRequestMessage(HttpMethod.Put, API);
            var command = new SolutionChangeCommand
            {
                Id   = Solution.Id,
                Name = this.GetRandom()
            };

            message.AddJsonContent(command);
            var responseMessage = await this.HttpClient.SendAsync(message);

            await responseMessage.AsResult();

            var newSolution = await this.Get(Solution.Id);

            Assert.NotEqual(command.Name, Solution.Name);
            Assert.Equal(command.Name, newSolution.Name);
        }
        public async Task <object> Put(SolutionChangeCommand command)
        {
            await this._mediator.Send(command);

            return(ResponseResult.Success);
        }
Beispiel #3
0
 public Task Handle(SolutionChangeCommand command)
 {
     return(this.Update(command.Id, s => s.Change(command)));
 }
Beispiel #4
0
 public void Change(SolutionChangeCommand Command) => this.Apply <SolutionChangeEvent>(Command);