Skip to content

Commit

Permalink
Fix object.ToString tests (#20640)
Browse files Browse the repository at this point in the history
Don't compare client- to server-generated string representations in cases where they may vary.
  • Loading branch information
roji authored Apr 15, 2020
2 parents 5f4fab4 + 8357604 commit 7e81ebb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
10 changes: 2 additions & 8 deletions test/EFCore.Specification.Tests/BuiltInDataTypesTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2011,13 +2011,8 @@ public virtual void Object_to_string_conversion()
Uint = b.TestUnsignedInt32.ToString(),
Long = b.TestInt64.ToString(),
Ulong = b.TestUnsignedInt64.ToString(),
Float = b.TestSingle.ToString(),
Double = b.TestDouble.ToString(),
Decimal = b.TestDecimal.ToString(),
Char = b.TestCharacter.ToString(),
DateTime = b.TestDateTime.ToString(),
DateTimeOffset = b.TestDateTimeOffset.ToString(),
TimeSpan = b.TestTimeSpan.ToString(),
Char = b.TestCharacter.ToString()
})
.First();

Expand All @@ -2039,7 +2034,7 @@ public virtual void Object_to_string_conversion()
Char = b.TestCharacter.ToString(),
DateTime = b.TestDateTime.ToString(),
DateTimeOffset = b.TestDateTimeOffset.ToString(),
TimeSpan = b.TestTimeSpan.ToString(),
TimeSpan = b.TestTimeSpan.ToString()
})
.ToList();

Expand All @@ -2054,7 +2049,6 @@ public virtual void Object_to_string_conversion()
Assert.Equal(expected.Ulong, actual.Ulong);
Assert.Equal(expected.Decimal, actual.Decimal);
Assert.Equal(expected.Char, actual.Char);
Assert.Equal(expected.TimeSpan, actual.TimeSpan);
}

public abstract class BuiltInDataTypesFixtureBase : SharedStoreFixtureBase<PoolableDbContext>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ protected ConvertToProviderTypesTestBase(TFixture fixture)
{
}

public override void Object_to_string_conversion() {}

public abstract class ConvertToProviderTypesFixtureBase : BuiltInDataTypesFixtureBase
{
protected override string StoreName { get; } = "ConvertToProviderTypes";
Expand Down
2 changes: 2 additions & 0 deletions test/EFCore.Specification.Tests/CustomConvertersTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,8 @@ protected enum Roles
Seller
}

public override void Object_to_string_conversion() {}

public abstract class CustomConvertersFixtureBase : BuiltInDataTypesFixtureBase
{
protected override string StoreName { get; } = "CustomConverters";
Expand Down

0 comments on commit 7e81ebb

Please sign in to comment.