Fix Null Warnings (#874)

* Fixing null warnings

* Fix null warnings
Fix other compiler warnings
This commit is contained in:
Steve Smith
2023-03-20 11:52:14 -04:00
committed by GitHub
parent a2ebd3fe26
commit d2412a84a9
38 changed files with 400 additions and 285 deletions

View File

@@ -45,6 +45,6 @@ public class BasketPageCheckout : IClassFixture<TestApplication>
formContent = new FormUrlEncodedContent(keyValues);
var postResponse2 = await Client.PostAsync("/Basket/Checkout", formContent);
Assert.Contains("/Identity/Account/Login", postResponse2.RequestMessage.RequestUri.ToString());
Assert.Contains("/Identity/Account/Login", postResponse2!.RequestMessage!.RequestUri!.ToString()!);
}
}

View File

@@ -62,7 +62,7 @@ public class CheckoutTest : IClassFixture<TestApplication>
var checkOutResponse = await Client.PostAsync("/basket/checkout", checkOutContent);
var stringCheckOutResponse = await checkOutResponse.Content.ReadAsStringAsync();
Assert.Contains("/Basket/Success", checkOutResponse.RequestMessage.RequestUri.ToString());
Assert.Contains("/Basket/Success", checkOutResponse.RequestMessage!.RequestUri!.ToString());
Assert.Contains("Thanks for your Order!", stringCheckOutResponse);
}
}

View File

@@ -52,7 +52,7 @@ public class IndexTest : IClassFixture<TestApplication>
var stringUpdateResponse = await updateResponse.Content.ReadAsStringAsync();
Assert.Contains("/basket/update", updateResponse.RequestMessage.RequestUri.ToString());
Assert.Contains("/basket/update", updateResponse!.RequestMessage!.RequestUri!.ToString()!);
decimal expectedTotalAmount = 416.50M;
Assert.Contains(expectedTotalAmount.ToString("N2"), stringUpdateResponse);
}
@@ -92,7 +92,7 @@ public class IndexTest : IClassFixture<TestApplication>
var stringUpdateResponse = await updateResponse.Content.ReadAsStringAsync();
Assert.Contains("/basket/update", updateResponse.RequestMessage.RequestUri.ToString());
Assert.Contains("/basket/update", updateResponse!.RequestMessage!.RequestUri!.ToString()!);
Assert.Contains("Basket is empty", stringUpdateResponse);
}
}