Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void IsUsingWithStartUpClassShouldThrowExceptionWithServiceProviderWhenTe

TestServiceProvider.GetService<IInjectedService>();
},
"Testing services could not be resolved. If your ConfigureServices method returns an IServiceProvider, you should either change it to return 'void' or manually register the required testing services by calling one of the provided IServiceCollection extension methods in the 'MyTested.AspNetCore.Mvc' namespace.");
"Testing services could not be resolved. If your ConfigureServices method returns an IServiceProvider, you should either change it to return 'void' or manually register the required testing services by calling one of the provided IServiceCollection extension methods in the 'MyTested.AspNetCore.Mvc' namespace. An easy way to do the second option is to add a TestStartup class at the root of your test project and invoke the extension methods there.");

MyApplication.StartsFrom<DefaultStartup>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ public void AreDeeplyEqualShouldReportCorrectlyWithPrimitiveAndStructTypes()
Assert.False(Reflection.AreDeeplyEqual(1, "1", out result));
Assert.Equal("Expected a value of Int32 type, but in fact it was String", result.ToString());
Assert.False(Reflection.AreDeeplyEqual(new DateTime(2015, 10, 19), new DateTime(2015, 10, 20), out result));
Assert.Equal("Difference occurs at 'DateTime.== (Equality Operator)'. Expected a value of '10/19/2015 12:00:00 AM', but in fact it was '10/20/2015 12:00:00 AM'", result.ToString());
Assert.Equal($"Difference occurs at 'DateTime.== (Equality Operator)'. Expected a value of '{new DateTime(2015, 10, 19)}', but in fact it was '{new DateTime(2015, 10, 20)}'", result.ToString());
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ public void MemoryCacheWithBuilderShouldThrowWithMemoryCacheEntryOptionsAndIncor
[Fact]
public void MemoryCacheWithBuilderShouldThrowWithMemoryCacheEntryOptionsWithInvalidAbsoluteExpiration()
{
var invalidExpirationDate = new DateTime(2017, 1, 1, 1, 1, 1, DateTimeKind.Utc);
var invalidExpirationDate = new DateTimeOffset(new DateTime(2017, 1, 1, 1, 1, 1, DateTimeKind.Utc));
var actualExpirationDate = new DateTimeOffset(new DateTime(2016, 1, 1, 1, 1, 1, DateTimeKind.Utc));

Test.AssertException<DataProviderAssertionException>(
() =>
Expand All @@ -280,7 +281,7 @@ public void MemoryCacheWithBuilderShouldThrowWithMemoryCacheEntryOptionsWithInva
.MemoryCache(cache => cache
.ContainingEntry("test", "value", new MemoryCacheEntryOptions
{
AbsoluteExpiration = new DateTimeOffset(invalidExpirationDate),
AbsoluteExpiration = invalidExpirationDate,
AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(1),
Priority = CacheItemPriority.High,
SlidingExpiration = TimeSpan.FromMinutes(5)
Expand All @@ -289,7 +290,7 @@ public void MemoryCacheWithBuilderShouldThrowWithMemoryCacheEntryOptionsWithInva
.ShouldReturn()
.Ok();
},
"When calling AddMemoryCacheAction action in MvcController expected memory cache to have entry with the given options, but in fact they were different. Difference occurs at 'MemoryCacheEntryOptions.AbsoluteExpiration.== (Equality Operator)'. Expected a value of '1/1/2017 1:01:01 AM +00:00', but in fact it was '1/1/2016 1:01:01 AM +00:00'.");
$"When calling AddMemoryCacheAction action in MvcController expected memory cache to have entry with the given options, but in fact they were different. Difference occurs at 'MemoryCacheEntryOptions.AbsoluteExpiration.== (Equality Operator)'. Expected a value of '{invalidExpirationDate}', but in fact it was '{actualExpirationDate}'.");
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ public void MemoryCacheWithBuilderShouldThrowWithMemoryCacheEntryOptionsAndIncor
[Fact]
public void MemoryCacheWithBuilderShouldThrowWithMemoryCacheEntryOptionsWithInvalidAbsoluteExpiration()
{
var invalidExpirationDate = new DateTime(2017, 1, 1, 1, 1, 1, DateTimeKind.Utc);
var invalidExpirationDate = new DateTimeOffset(new DateTime(2017, 1, 1, 1, 1, 1, DateTimeKind.Utc));
var actualExpirationDate = new DateTimeOffset(new DateTime(2016, 1, 1, 1, 1, 1, DateTimeKind.Utc));

Test.AssertException<DataProviderAssertionException>(
() =>
Expand All @@ -253,7 +254,7 @@ public void MemoryCacheWithBuilderShouldThrowWithMemoryCacheEntryOptionsWithInva
.MemoryCache(cache => cache
.ContainingEntry("test", "value", new MemoryCacheEntryOptions
{
AbsoluteExpiration = new DateTimeOffset(invalidExpirationDate),
AbsoluteExpiration = invalidExpirationDate,
AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(1),
Priority = CacheItemPriority.High,
SlidingExpiration = TimeSpan.FromMinutes(5)
Expand All @@ -262,7 +263,7 @@ public void MemoryCacheWithBuilderShouldThrowWithMemoryCacheEntryOptionsWithInva
.ShouldReturn()
.View();
},
"When invoking MemoryCacheValuesComponent expected memory cache to have entry with the given options, but in fact they were different. Difference occurs at 'MemoryCacheEntryOptions.AbsoluteExpiration.== (Equality Operator)'. Expected a value of '1/1/2017 1:01:01 AM +00:00', but in fact it was '1/1/2016 1:01:01 AM +00:00'.");
$"When invoking MemoryCacheValuesComponent expected memory cache to have entry with the given options, but in fact they were different. Difference occurs at 'MemoryCacheEntryOptions.AbsoluteExpiration.== (Equality Operator)'. Expected a value of '{invalidExpirationDate}', but in fact it was '{actualExpirationDate}'.");
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void WithCultureShouldThrowExceptionWithIncorrectValue()
.WithJsonSerializerSettings(s =>
s.WithCulture(CultureInfo.GetCultureInfo("en-US"))));
},
"When calling JsonWithSettingsAction action in MvcController expected JSON result serializer settings to have 'English (United States)' culture, but in fact found 'Unknown language'.");
$"When calling JsonWithSettingsAction action in MvcController expected JSON result serializer settings to have '{CultureInfo.GetCultureInfo("en-US").DisplayName}' culture, but in fact found '{CultureInfo.InvariantCulture.DisplayName}'.");
}

[Fact]
Expand Down