Skip to content

Commit 8b384ab

Browse files
committed
updated
1 parent 686e8fb commit 8b384ab

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

src/Api.Test/EndpointsTests/UnitTests/V1/Products/ReadTest.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ public void Dispose()
4242
public async Task GetAsync_Gets_All_Product_Successfully()
4343
{
4444
//Given
45-
var products = new List<Product>();
46-
products.Add(SampleDataV1.Product);
47-
products.Add(SampleDataV1.Product);
48-
moqDatabase.Products.AddRange(products); //adding the products to be database
45+
var products = new List<Product>
46+
{
47+
SampleDataV1.Product,
48+
SampleDataV1.Product
49+
};
50+
moqDatabase.Products.AddRange(products); //adding the products to be database
4951
await moqDatabase.SaveChangesAsync(); //saving the product to be deleted
5052

5153
//When

src/Api.Test/appsettings.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,5 @@
66
"Microsoft.Hosting.Lifetime": "Information"
77
}
88
},
9-
"ConnectionStrings": {
10-
"SqlLite": "Filename=Product.db"
11-
},
12-
"FeatureManagement": {
13-
"PRODUCT": "true",
14-
"PRODUCTOPTION": "true"
15-
},
16-
179
"AllowedHosts": "*"
1810
}

src/Api/Endpoints/V1/Products/Delete.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public async Task<IActionResult> DeleteAsync(Guid id, string culture = "en-US")
3333

3434
if (product == default) return NotFound(string.Format(CustomException.NotFoundException, id));
3535

36-
var productRemoved = _db.Products.Remove(product);
36+
_db.Products.Remove(product);
3737
rowCountDeleted = await _db.SaveChangesAsync();
3838

3939
return deleted ? NoContent() : StatusCode(StatusCodes.Status500InternalServerError);

src/Api/Xero.Demo.Infrastructure/Languages/JsonRequestCultureProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public override Task<ProviderCultureResult> DetermineProviderCultureResult(HttpC
2121

2222
var culture = parts[2];
2323

24-
culture = culture ?? "en-US";
24+
culture ??= "en-US";
2525

2626
return Task.FromResult(new ProviderCultureResult(culture));
2727
}

src/Api/Xero.Demo.Infrastructure/MiddleWares/JwtMiddleware.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ public async Task Invoke(HttpContext context, IUserService userService)
2727
{
2828
var token = context.Request.Headers[CONSTANTS.Authorization].FirstOrDefault()?.Split(" ").Last();
2929

30-
if (token != null) attachUserToContext(context, userService, token);
30+
if (token != null) AttachUserToContext(context, userService, token);
3131

3232
await _next(context);
3333
}
3434

35-
private void attachUserToContext(HttpContext context, IUserService userService, string token)
35+
private void AttachUserToContext(HttpContext context, IUserService userService, string token)
3636
{
3737
try
3838
{

0 commit comments

Comments
 (0)