Exemple #1
0
        public void AddEnrollment_ValidRequest_Ok()
        {
            var sut = GetSut(out Mock <IAddEnrollmentDomainService> addEnrollmentDomainServiceMock);

            addEnrollmentDomainServiceMock.Setup(x => x.Add(It.IsAny <EnrollmentRequest>()));

            var command = new AddEnrollmentCommand
            {
                Request = SharedMethods.GetEnrollmentRequest()
            };

            Assert.DoesNotThrow(() => sut.Add(command));

            addEnrollmentDomainServiceMock.Verify(x => x.Add(It.IsAny <EnrollmentRequest>()));
        }
Exemple #2
0
        public void Add(AddEnrollmentCommand command)
        {
            command.Request.Validate();

            _addEnrollmentDomainService.Add(command.Request);
        }
Exemple #3
0
 public void Post([FromBody] AddEnrollmentCommand command)
 {
     _addEnrollmentAppService.Add(command);
 }