minor code cleanup

This commit is contained in:
daver32
2022-01-28 21:08:29 +01:00
parent 6f6d5d0f33
commit 71b4ecc9b4
6 changed files with 61 additions and 69 deletions
@@ -32,7 +32,7 @@ namespace InterfaceGenerator.Tests
public void PublicProperty_IsImplemented()
{
var prop = typeof(IAccessorsTestsService)
.GetProperty(nameof(IAccessorsTestsService.PublicProperty));
.GetProperty(nameof(IAccessorsTestsService.PublicProperty))!;
prop.Should().NotBeNull();
@@ -47,14 +47,14 @@ namespace InterfaceGenerator.Tests
public void InitProperty_IsImplemented()
{
var prop = typeof(IAccessorsTestsService)
.GetProperty(nameof(IAccessorsTestsService.InitOnlyProperty));
.GetProperty(nameof(IAccessorsTestsService.InitOnlyProperty))!;
prop.Should().NotBeNull();
prop.GetMethod.Should().NotBeNull();
prop.SetMethod.Should().NotBeNull();
prop.SetMethod.ReturnParameter.GetRequiredCustomModifiers().Should().Contain(typeof(IsExternalInit));
prop.SetMethod!.ReturnParameter!.GetRequiredCustomModifiers().Should().Contain(typeof(IsExternalInit));
string _ = _sut.InitOnlyProperty;
}
@@ -63,7 +63,7 @@ namespace InterfaceGenerator.Tests
public void PrivateSetter_IsOmitted()
{
var prop = typeof(IAccessorsTestsService)
.GetProperty(nameof(IAccessorsTestsService.PropertyWithPrivateSetter));
.GetProperty(nameof(IAccessorsTestsService.PropertyWithPrivateSetter))!;
prop.Should().NotBeNull();
@@ -77,7 +77,7 @@ namespace InterfaceGenerator.Tests
public void PrivateGetter_IsOmitted()
{
var prop = typeof(IAccessorsTestsService)
.GetProperty(nameof(IAccessorsTestsService.PropertyWithPrivateGetter));
.GetProperty(nameof(IAccessorsTestsService.PropertyWithPrivateGetter))!;
prop.Should().NotBeNull();
@@ -91,7 +91,7 @@ namespace InterfaceGenerator.Tests
public void ProtectedSetter_IsOmitted()
{
var prop = typeof(IAccessorsTestsService)
.GetProperty(nameof(IAccessorsTestsService.PropertyWithProtectedSetter));
.GetProperty(nameof(IAccessorsTestsService.PropertyWithProtectedSetter))!;
prop.Should().NotBeNull();
@@ -105,7 +105,7 @@ namespace InterfaceGenerator.Tests
public void ProtectedGetter_IsOmitted()
{
var prop = typeof(IAccessorsTestsService)
.GetProperty(nameof(IAccessorsTestsService.PropertyWithProtectedGetter));
.GetProperty(nameof(IAccessorsTestsService.PropertyWithProtectedGetter))!;
prop.Should().NotBeNull();