コード例 #1
0
        public async Task Get_My_Lists_Returns_Ok()
        {
            //Arrange

            //Act
            int listsCount    = _listRepository.Count();
            var iactionResult = await _listsController.Get(_uniqueToken);

            var objectResponse = iactionResult as ObjectResult;
            var resultObject   = objectResponse.Value as List <Backend.Models.Database.TodoList>;

            //Assert
            Assert.Equal(resultObject.Count, listsCount);
            Assert.IsType <OkObjectResult>(iactionResult);
            Assert.Equal(200, objectResponse.StatusCode);
        }
コード例 #2
0
        public void Test_Get()
        {
            //Arrange
            var controller = new ListsController(listService);

            //Act
            var result = controller.Get();

            //Assert
            Assert.IsInstanceOfType(result.Value, typeof(List <ToDoList>));
            Assert.AreEqual(result.Value.Count, 2);
        }
コード例 #3
0
        public void Test_Get_WithId()
        {
            //Arrange
            var controller = new ListsController(listService);

            //Act
            var result = controller.Get("1");

            //Assert
            Assert.IsInstanceOfType(result.Value, typeof(ToDoList));
            Assert.AreEqual(result.Value.Id, data[0].Id);
            Assert.AreEqual(result.Value.Name, data[0].Name);
            Assert.AreEqual(result.Value.Items.Count, data[0].Items.Count);
        }