Пример #1
0
        public async Task InsertWorksAsync()
        {
            var note = new TodoNote {
                Note = "testing"
            };

            var actionResult = await m_controller.PostAsync(note);

            var createdResult = actionResult as CreatedAtRouteNegotiatedContentResult <Todo>;

            Assert.IsNotNull(createdResult);
            Assert.AreEqual("DefaultApi", createdResult.RouteName);
            Assert.AreNotEqual(Guid.Empty, createdResult.RouteValues["id"]);
            Assert.AreNotEqual(Guid.Empty, createdResult.Content.Id);
            Assert.AreNotEqual(new DateTime().Ticks, createdResult.Content.DateTime.Ticks);
        }