public void GetCommandItemsReturnsZeroItemsWhenDBIsEmpty()
        {
            var result = controller.GetCommandItems();

            // Assert
            Assert.Empty(result.Value);
        }
Beispiel #2
0
        public void GetCommandItems_ReturnsZeroItems_WhenDBIsEmpty()
        {
            //ACT
            var result = controller.GetCommandItems();

            //ASSERT
            Assert.Empty(result.Value);
        }
Beispiel #3
0
        public void GetCommandItems_ReturnsZeroItems_WhenDBIsEmpty()
        {
            // call
            var result = controller.GetCommandItems();

            // verify
            Assert.IsEmpty(result.Value);
        }
Beispiel #4
0
        public void GetCommandItems_ReturnsZeroItems_WhenDBIsEmpty()
        {
            //Arrange
            //Act
            var result = commandsController.GetCommandItems();

            //Assert
            Assert.Empty(result.Value);
        }
        public void GetCommandItems_ReturnsZeroItems_WhenDBIsEmpty()
        {
            //Given

            //When
            var result = controller.GetCommandItems();

            //Then
            Assert.Empty(result.Value);
        }
Beispiel #6
0
        public void GetCommandItems_ReturnsZeroItems_WhenDBIsEmpty()
        {
            //Action 1 Test : GET /api/commands
            //Test 1.1 : Condition = Request Object when none exists : Expected Result = Return nothing
            //TEST 1.1 REQUEST OBJECTS WHEN NONE EXIST – RETURN "NOTHING"
            //ACT
            var result = _controller.GetCommandItems();

            //Assert
            Assert.Empty(result.Value);
        }
        public void GetCommandItems_ReturnsZeroItems_WhenDBIsEmpty()
        {
            //ARRANGE
            //DBContext


            //controller
            //var controller=new CommandsController(dbContext);

            //ACT
            var result = controller.GetCommandItems();

            //ASSERT
            Assert.Empty(result.Value);
        }
        public void GetCommandItemsReturnsOneItemWhenDBHasOneObject()
        {
            //Arrange
            var command = new Command {
                HowTo       = "Do Somethting",
                Platform    = "Some Platform",
                CommandLine = "Some Command"
            };

            dbContext.CommandItems.Add(command);
            dbContext.SaveChanges();
            //Act
            var result = controller.GetCommandItems();

            //Assert
            Assert.Single(result.Value);
        }
        public void GetCommandItems_ReturnsZeroItems_WhenDBIsEmpty()
        {
            //ARRANGE
            //DBContext
            var optionsBuilder = new DbContextOptionsBuilder <CommandContext> ();

            optionsBuilder.UseInMemoryDatabase("UnitTestInMemBD");
            var dbContext = new CommandContext(optionsBuilder.Options);

            //Controller
            var controller = new CommandsController(dbContext);

            //ACT
            var result = controller.GetCommandItems();

            //ASSERT
            Assert.Empty(result.Value);
        }