Exemple #1
0
        public void AddMeeting_GivenValidModel_ReturnsTrue()
        {
            // Arrange
            var model = new MeetingModel();

            _repoMock.Setup(x => x.Add(It.IsAny <Meeting>()));

            // Act
            var result = _meetingService.AddMeeting(model);

            // Assert
            Assert.IsTrue(result);
        }
        public IActionResult Create([FromBody] MeetingWebModel webModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var model = Mapper.Map <MeetingModel>(webModel);

            var isSuccess = _meetingService.AddMeeting(model);

            if (!isSuccess)
            {
                return(BadRequest());
            }

            return(new OkObjectResult(JsonConvert.SerializeObject("Meeting added")));
        }
 public void Post([FromBody] MeetingRegistrationInfo value)
 {
     meetingService.AddMeeting(value);
 }