Skip to content
This repository has been archived by the owner on Jun 25, 2022. It is now read-only.

Commit

Permalink
refactor: Use 'IsNotNull' instead of 'NotNull'
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosPavajeau committed Jan 17, 2021
1 parent fbbbf8c commit c91dd78
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Kaizen.Test/Controllers/ProductsControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,25 @@ public async Task GetProducts()
{
OkObjectResult result = (await _productsController.GetProducts()).Result as OkObjectResult;

Assert.NotNull(result);
Assert.NotNull(result.Value);
Assert.IsNotNull(result);
Assert.IsNotNull(result.Value);
}

[Test]
public async Task Get_Existing_Product()
{
ActionResult<ProductViewModel> result = await _productsController.GetProduct("123");

Assert.NotNull(result);
Assert.NotNull(result.Value);
Assert.IsNotNull(result);
Assert.IsNotNull(result.Value);
}

[Test]
public async Task Get_Non_Existent_Product()
{
ActionResult<ProductViewModel> result = await _productsController.GetProduct("321");

Assert.NotNull(result);
Assert.IsNotNull(result);
Assert.IsNull(result.Value);
Assert.IsInstanceOf<NotFoundObjectResult>(result.Result);
}
Expand All @@ -103,7 +103,7 @@ public async Task Check_Product_Exists()
{
bool result = await _productsController.CheckExists("123");

Assert.NotNull(result);
Assert.IsNotNull(result);
Assert.IsTrue(result);
}

Expand All @@ -115,8 +115,8 @@ public async Task Update_Existing_Product()
Name = "Pesticida de insectos"
});

Assert.NotNull(result);
Assert.NotNull(result.Value);
Assert.IsNotNull(result);
Assert.IsNotNull(result.Value);
Assert.AreEqual("Pesticida de insectos", result.Value.Name);
}

Expand All @@ -128,7 +128,7 @@ public async Task Update_Non_Existent_Product()
Name = "Pesticida de insectos"
});

Assert.NotNull(result);
Assert.IsNotNull(result);
Assert.Null(result.Value);
Assert.IsInstanceOf<BadRequestObjectResult>(result.Result);
}
Expand All @@ -143,8 +143,8 @@ public async Task Save_New_Product()
Amount = 3
});

Assert.NotNull(result);
Assert.NotNull(result.Value);
Assert.IsNotNull(result);
Assert.IsNotNull(result.Value);
}

[Test]
Expand All @@ -159,7 +159,7 @@ public async Task Save_Existing_Product()
Amount = 3
});

Assert.NotNull(result);
Assert.IsNotNull(result);
Assert.IsNull(result.Value);
Assert.IsInstanceOf<ConflictObjectResult>(result.Result);
}
Expand Down

0 comments on commit c91dd78

Please sign in to comment.