Exemplo n.º 1
0
        public async Task TestPutContactItemUpdate()
        {
            using (var context = new ContactBookAPIContext(options))
            {
                // Given
                string      title     = "putMeme";
                ContactItem memeItem1 = context.ContactItem.Where(x => x.Title == memeTitles[0]).Single();
                memeItem1.Title = title;

                // When
                ContactItemsController ContactController = new ContactItemsController(context, configuration);
                IActionResult          result            = await ContactController.PutContactItem(memeItem1.Id, memeItem1) as IActionResult;

                // Then
                memeItem1 = context.ContactItem.Where(x => x.Title == title).Single();
            }
        }
Exemplo n.º 2
0
        public async Task TestPutMemeContactNoContentStatusCode()
        {
            using (var context = new ContactBookAPIContext(options))
            {
                // Given
                string      title     = "putMeme";
                ContactItem memeItem1 = context.ContactItem.Where(x => x.Title == memeTitles[0]).Single();
                memeItem1.Title = title;

                // When
                ContactItemsController ContactController = new ContactItemsController(context, configuration);
                IActionResult          result            = await ContactController.PutContactItem(memeItem1.Id, memeItem1) as IActionResult;

                // Then
                Assert.IsNotNull(result);
                Assert.IsInstanceOfType(result, typeof(NoContentResult));
            }
        }