public void PostCallsLinkDataService()
 {
     Mock.Arrange(() => dataService.Add(Arg.IsAny <CreateLinkCommand>()))
     .Returns(() => Task.FromResult(true))
     .Occurs(1);
     target.Post(defaultRequest);
     Mock.Assert(dataService);
 }
Beispiel #2
0
        public void Post_returns_bad_request_when_empty_url_passed()
        {
            // act
            var result           = _sut.Post(string.Empty);
            var badRequestResult = result as BadRequestResult;

            // assert
            Assert.NotNull(badRequestResult);
            Assert.Equal(400, badRequestResult.StatusCode);
        }