Skip to content

Commit

Permalink
move ObjectExtensionTests to seperate file
Browse files Browse the repository at this point in the history
  • Loading branch information
calebjenkins committed Jan 2, 2024
1 parent 06b55ad commit 876dedd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
24 changes: 24 additions & 0 deletions src/ExtensionTests/ObjectExtensionTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

namespace ExtensionTests;

using Calebs.Extensions;

public class ObjectExtensionTests
{
[Fact]
public void Nullable_Objects_Should_Return_Empty_String()
{
ExampleModel m = null;
var result = m.ToSafeString();
result.IsNullOrEmpty().Should().BeTrue();
}

[Fact]
public void Int_Should_Return_String_Value()
{
int five = 5;
var result = five.ToSafeString();
result.Should().Be("5");
}
}

22 changes: 1 addition & 21 deletions src/ExtensionTests/StringExtensionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,4 @@ public void ShouldReturnValueIfNotNull()

v2.Should().Be(value);
}
}

public class ObjectExtensionTests
{
[Fact]
public void Nullable_Objects_Should_Return_Empty_String()
{
ExampleModel m = null;
var result = m.ToSafeString();
result.IsNullOrEmpty().Should().BeTrue();
}

[Fact]
public void Int_Should_Return_String_Value()
{
int five = 5;
var result = five.ToSafeString();
result.Should().Be("5");
}
}

}

0 comments on commit 876dedd

Please sign in to comment.