コード例 #1
0
 public IActionResult Post([FromBody] string input)
 {
     try
     {
         _recordsService.AddFromString(input);
         return(Ok());
     }
     catch
     {
         return(BadRequest());
     }
 }
コード例 #2
0
 public void AddFromStringTestNullstring()
 {
     Assert.Throws <ArgumentNullException>(() => { _service.AddFromString(null); });
     _repoMock.Verify(x => x.AddRecord(It.IsAny <Person>()), Times.Never);
 }