コード例 #1
0
        public async Task <IHttpActionResult> GetAsync(Guid id)
        {
            ModelStateIdValidation(id);

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (!await _retrievalService.Exists(id))
            {
                return(NotFound());
            }

            var foundNote = await _retrievalService.GetByIdAsync(id);

            return(Ok(foundNote));
        }
コード例 #2
0
        public async Task ExistsAsync_ExistingNote_TrueReturned()
        {
            var isExisting = await _retrievalService.Exists(Note.Id);

            Assert.That(isExisting, Is.True);
        }