Skip to content

Commit 4a01e1f

Browse files
committed
Fix some warnings
1 parent 6f5c3bd commit 4a01e1f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Patterns/Proxy/EntriesProxy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public bool Delete(int id)
1919
}
2020
return result;
2121
}
22-
public IProductInfo Get(int id)
22+
public IProductInfo? Get(int id)
2323
{
24-
return _realEntries.Get(id);
24+
return _realEntries?.Get(id) ?? null;
2525
}
2626

2727
}

Tests/PrototypeTest.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Xunit;
22
using FluentAssertions;
3-
using Moq;
43

54
namespace Prototype.Test
65
{
@@ -41,7 +40,7 @@ public void ShallowCloneCustomerWithSameAddress_WhenAddressObjectsAreShared()
4140
var newStreetAddress = "26 York Street";
4241
var relatedCustomer = (Customer)customer.Clone();
4342
relatedCustomer.FirstName = "Jane";
44-
relatedCustomer.HomeAddress.StreetAddress = newStreetAddress;
43+
relatedCustomer.HomeAddress!.StreetAddress = newStreetAddress;
4544

4645
// Assert
4746
customer.HomeAddress.Should().Be(relatedCustomer.HomeAddress);
@@ -57,7 +56,7 @@ public void DeepCloneCustomerWithDifferentAddressButWithSameFirstName_WhenAddres
5756
var diffCustomer = customer.DeepClone();
5857
diffCustomer.FirstName = "Peter";
5958
diffCustomer.LastName = "Wick";
60-
diffCustomer.HomeAddress.StreetAddress = "57 Hassall Ridge";
59+
diffCustomer.HomeAddress!.StreetAddress = "57 Hassall Ridge";
6160
diffCustomer.HomeAddress.City = "Lexington";
6261
diffCustomer.HomeAddress.State = "Kentucky";
6362
diffCustomer.HomeAddress.Country = "United States Of America";

0 commit comments

Comments
 (0)