Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix xunit warnings #3636

Merged
merged 8 commits into from
Oct 29, 2018
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
2 changes: 1 addition & 1 deletion src/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<PackageIconUrl>http://getakka.net/images/akkalogo.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/akkadotnet/akka.net</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/akkadotnet/akka.net/blob/master/LICENSE</PackageLicenseUrl>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<NoWarn>$(NoWarn);CS1591;xUnit1013</NoWarn>
</PropertyGroup>
<PropertyGroup>
<XunitVersion>2.3.1</XunitVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void Should_sqlite_journal_has_default_config()
Assert.Equal(TimeSpan.FromSeconds(30), config.GetTimeSpan("connection-timeout"));
Assert.Equal("event_journal", config.GetString("table-name"));
Assert.Equal("journal_metadata", config.GetString("metadata-table-name"));
Assert.Equal(false, config.GetBoolean("auto-initialize"));
Assert.False(config.GetBoolean("auto-initialize"));
Assert.Equal("Akka.Persistence.Sql.Common.Journal.DefaultTimestampProvider, Akka.Persistence.Sql.Common", config.GetString("timestamp-provider"));
}

Expand All @@ -55,7 +55,7 @@ public void Should_sqlite_snapshot_has_default_config()
Assert.Equal(string.Empty, config.GetString("connection-string-name"));
Assert.Equal(TimeSpan.FromSeconds(30), config.GetTimeSpan("connection-timeout"));
Assert.Equal("snapshot_store", config.GetString("table-name"));
Assert.Equal(false, config.GetBoolean("auto-initialize"));
Assert.False(config.GetBoolean("auto-initialize"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public void Hyperion_serializer_should_have_correct_defaults()
using (var system = ActorSystem.Create(nameof(HyperionConfigTests), config))
{
var serializer = (HyperionSerializer)system.Serialization.FindSerializerForType(typeof(object));
Assert.Equal(true, serializer.Settings.VersionTolerance);
Assert.Equal(true, serializer.Settings.PreserveObjectReferences);
Assert.True(serializer.Settings.VersionTolerance);
Assert.True(serializer.Settings.PreserveObjectReferences);
Assert.Equal("NoKnownTypes", serializer.Settings.KnownTypesProvider.Name);
}
}
Expand All @@ -54,8 +54,8 @@ public void Hyperion_serializer_should_allow_to_setup_custom_flags()
using (var system = ActorSystem.Create(nameof(HyperionConfigTests), config))
{
var serializer = (HyperionSerializer)system.Serialization.FindSerializerForType(typeof(object));
Assert.Equal(false, serializer.Settings.VersionTolerance);
Assert.Equal(false, serializer.Settings.PreserveObjectReferences);
Assert.False(serializer.Settings.VersionTolerance);
Assert.False(serializer.Settings.PreserveObjectReferences);
Assert.Equal("NoKnownTypes", serializer.Settings.KnownTypesProvider.Name);
}
}
Expand All @@ -77,8 +77,8 @@ public void Hyperion_serializer_should_allow_to_setup_custom_types_provider_with
using (var system = ActorSystem.Create(nameof(HyperionConfigTests), config))
{
var serializer = (HyperionSerializer)system.Serialization.FindSerializerForType(typeof(object));
Assert.Equal(true, serializer.Settings.VersionTolerance);
Assert.Equal(true, serializer.Settings.PreserveObjectReferences);
Assert.True(serializer.Settings.VersionTolerance);
Assert.True(serializer.Settings.PreserveObjectReferences);
Assert.Equal(typeof(DummyTypesProviderWithDefaultCtor), serializer.Settings.KnownTypesProvider);
}
}
Expand All @@ -100,8 +100,8 @@ public void Hyperion_serializer_should_allow_to_setup_custom_types_provider_with
using (var system = ActorSystem.Create(nameof(HyperionConfigTests), config))
{
var serializer = (HyperionSerializer)system.Serialization.FindSerializerForType(typeof(object));
Assert.Equal(true, serializer.Settings.VersionTolerance);
Assert.Equal(true, serializer.Settings.PreserveObjectReferences);
Assert.True(serializer.Settings.VersionTolerance);
Assert.True(serializer.Settings.PreserveObjectReferences);
Assert.Equal(typeof(DummyTypesProvider), serializer.Settings.KnownTypesProvider);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ public void CanSerializeActorRefWithUID()
var aref = ActorOf<BlackHoleActor>();
var surrogate = aref.ToSurrogate(Sys) as ActorRefBase.Surrogate;
var uid = aref.Path.Uid;
Assert.True(surrogate.Path.Contains("#" + uid));
Assert.Contains("#" + uid, surrogate.Path);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void No_abstract_classes()
public void Deeply_inherited_are_ok()
{
var discoveredSpecs = DiscoverSpecs();
Assert.Equal(discoveredSpecs[KeyFromSpecName(nameof(DiscoveryCases.DeeplyInheritedChildSpec))].First().Role, "DeeplyInheritedChildRole");
Assert.Equal("DeeplyInheritedChildRole", discoveredSpecs[KeyFromSpecName(nameof(DiscoveryCases.DeeplyInheritedChildSpec))].First().Role);
}

[Fact(DisplayName = "Child test class with default constructors are ok")]
Expand All @@ -48,9 +48,9 @@ public void Child_class_with_default_constructor_are_ok()
public void Discovered_count_equals_number_of_roles_mult_specs()
{
var discoveredSpecs = DiscoverSpecs();
Assert.Equal(discoveredSpecs[KeyFromSpecName(nameof(DiscoveryCases.FloodyChildSpec1))].Count, 5);
Assert.Equal(discoveredSpecs[KeyFromSpecName(nameof(DiscoveryCases.FloodyChildSpec2))].Count, 5);
Assert.Equal(discoveredSpecs[KeyFromSpecName(nameof(DiscoveryCases.FloodyChildSpec3))].Count, 5);
Assert.Equal(5, discoveredSpecs[KeyFromSpecName(nameof(DiscoveryCases.FloodyChildSpec1))].Count);
Assert.Equal(5, discoveredSpecs[KeyFromSpecName(nameof(DiscoveryCases.FloodyChildSpec2))].Count);
Assert.Equal(5, discoveredSpecs[KeyFromSpecName(nameof(DiscoveryCases.FloodyChildSpec3))].Count);
}

[Fact(DisplayName = "Only public props and fields are considered when looking for RoleNames")]
Expand Down
4 changes: 2 additions & 2 deletions src/core/Akka.Remote.Tests/AccrualFailureDetectorSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public void AccrualFailureDetector_must_return_realistic_phi_values()
public void AccrualFailureDetector_must_return_phi_value_of_zero_on_startup_for_each_address_when_no_heartbeats()
{
var fd = FailureDetectorSpecHelpers.CreateFailureDetector();
Assert.Equal(fd.CurrentPhi, 0.0);
Assert.Equal(fd.CurrentPhi, 0.0);
Assert.Equal(0.0, fd.CurrentPhi);
Assert.Equal(0.0, fd.CurrentPhi);
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Remote.Tests/EndpointRegistrySpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public void EndpointRegistry_should_prune_outdated_Gated_directives_properly()
reg.MarkAsFailed(actorB, farIntheFuture);
reg.Prune();

Assert.Equal(null, reg.WritableEndpointWithPolicyFor(address1).AsInstanceOf<EndpointManager.WasGated>().RefuseUid);
Assert.Null(reg.WritableEndpointWithPolicyFor(address1).AsInstanceOf<EndpointManager.WasGated>().RefuseUid);
Assert.Equal(farIntheFuture, reg.WritableEndpointWithPolicyFor(address2).AsInstanceOf<EndpointManager.Gated>().TimeOfRelease);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void RemoteActorRefProvider_should_create_RemoteActorRef_for_nonlocaladdr
public void RemoteActorRefProvider_default_address_must_include_adapter_schemes()
{
var localAddress = RARP.For(Sys).Provider.DefaultAddress;
Assert.True(localAddress.ToString().StartsWith("akka.trttl.gremlin.tcp://"));
Assert.StartsWith("akka.trttl.gremlin.tcp://", localAddress.ToString());
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void TestActorRef_name_must_start_with_double_dollar_sign()
//creates a StringBuilder and adds adds $. Hence, 2 $$
var testActorRef = new TestActorRef<ReplyActor>(Sys, Props.Create<ReplyActor>());

Assert.Equal(testActorRef.Path.Name.Substring(0, 2), "$$");
Assert.Equal("$$", testActorRef.Path.Name.Substring(0, 2));
}

[Fact]
Expand Down
4 changes: 2 additions & 2 deletions src/core/Akka.Tests/Actor/ActorPathSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void ActorPath_Parse_HandlesCasing_ForLocal()
elements.Count.ShouldBe(2,"number of elements in path");
Assert.True("pAth1".Equals(elements[0], StringComparison.Ordinal), "first path element");
Assert.True("pAth2".Equals(elements[1], StringComparison.Ordinal), "second path element");
Assert.Equal(actorPath.ToString(),"akka://sYstEm/pAth1/pAth2");
Assert.Equal("akka://sYstEm/pAth1/pAth2", actorPath.ToString());
}

[Fact]
Expand All @@ -78,7 +78,7 @@ public void ActorPath_Parse_HandlesCasing_ForRemote()
elements.Count.ShouldBe(2, "number of elements in path");
Assert.True("pAth1".Equals(elements[0], StringComparison.Ordinal), "first path element");
Assert.True("pAth2".Equals(elements[1], StringComparison.Ordinal), "second path element");
Assert.Equal(actorPath.ToString(), "akka://sYstEm@host:4711/pAth1/pAth2");
Assert.Equal("akka://sYstEm@host:4711/pAth1/pAth2", actorPath.ToString());
}

[Fact]
Expand Down
16 changes: 8 additions & 8 deletions src/core/Akka.Tests/Actor/SupervisorStrategySpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class SupervisorStrategySpecs
};

[Theory]
[MemberData("RetriesTestData")]
[MemberData(nameof(RetriesTestData))]
public void A_constructed_OneForOne_supervisor_strategy_with_nullable_retries_has_the_expected_properties(int? retries, int expectedRetries)
{
var uut = new OneForOneStrategy(retries, null, exn => Directive.Restart);
Expand All @@ -41,7 +41,7 @@ public void A_constructed_OneForOne_supervisor_strategy_with_nullable_retries_ha
}

[Theory]
[MemberData("TimeoutTestData")]
[MemberData(nameof(TimeoutTestData))]
public void A_constructed_OneForOne_supervisor_strategy_with_nullable_timeouts_has_the_expected_properties(TimeSpan? timeout, int expectedTimeoutMilliseconds)
{
var uut = new OneForOneStrategy(-1, timeout, exn => Directive.Restart);
Expand All @@ -50,7 +50,7 @@ public void A_constructed_OneForOne_supervisor_strategy_with_nullable_timeouts_h
}

[Theory]
[MemberData("RetriesTestData")]
[MemberData(nameof(RetriesTestData))]
public void A_constructed_OneForOne_supervisor_strategy_with_nullable_retries_and_a_decider_has_the_expected_properties(int? retries, int expectedRetries)
{
var uut = new OneForOneStrategy(retries, null, Decider.From(Directive.Restart));
Expand All @@ -59,7 +59,7 @@ public void A_constructed_OneForOne_supervisor_strategy_with_nullable_retries_an
}

[Theory]
[MemberData("TimeoutTestData")]
[MemberData(nameof(TimeoutTestData))]
public void A_constructed_OneForOne_supervisor_strategy_with_nullable_timeouts_and_a_decider_has_the_expected_properties(TimeSpan? timeout, int expectedTimeoutMilliseconds)
{
var uut = new OneForOneStrategy(-1, timeout, Decider.From(Directive.Restart));
Expand All @@ -68,7 +68,7 @@ public void A_constructed_OneForOne_supervisor_strategy_with_nullable_timeouts_a
}

[Theory]
[MemberData("RetriesTestData")]
[MemberData(nameof(RetriesTestData))]
public void A_constructed_AllForOne_supervisor_strategy_with_nullable_retries_has_the_expected_properties(int? retries, int expectedRetries)
{
var uut = new AllForOneStrategy(retries, null, exn => Directive.Restart);
Expand All @@ -77,7 +77,7 @@ public void A_constructed_AllForOne_supervisor_strategy_with_nullable_retries_ha
}

[Theory]
[MemberData("TimeoutTestData")]
[MemberData(nameof(TimeoutTestData))]
public void A_constructed_AllForOne_supervisor_strategy_with_nullable_timeouts_has_the_expected_properties(TimeSpan? timeout, int expectedTimeoutMilliseconds)
{
var uut = new AllForOneStrategy(-1, timeout, exn => Directive.Restart);
Expand All @@ -86,7 +86,7 @@ public void A_constructed_AllForOne_supervisor_strategy_with_nullable_timeouts_h
}

[Theory]
[MemberData("RetriesTestData")]
[MemberData(nameof(RetriesTestData))]
public void A_constructed_AllForOne_supervisor_strategy_with_nullable_retries_and_a_decider_has_the_expected_properties(int? retries, int expectedRetries)
{
var uut = new OneForOneStrategy(retries, null, Decider.From(Directive.Restart));
Expand All @@ -95,7 +95,7 @@ public void A_constructed_AllForOne_supervisor_strategy_with_nullable_retries_an
}

[Theory]
[MemberData("TimeoutTestData")]
[MemberData(nameof(TimeoutTestData))]
public void A_constructed_AllForOne_supervisor_strategy_with_nullable_timeouts_and_a_decider_has_the_expected_properties(TimeSpan? timeout, int expectedTimeoutMilliseconds)
{
var uut = new OneForOneStrategy(-1, timeout, Decider.From(Directive.Restart));
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Tests/Configuration/ConfigurationSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void Can_create_config_from_source_object()
var config = ConfigurationFactory.FromObject(source);

Assert.Equal("aaa", config.GetString("StringProperty"));
Assert.Equal(true, config.GetBoolean("BoolProperty"));
Assert.True(config.GetBoolean("BoolProperty"));

Assert.Equal(new[] {1, 2, 3, 4}, config.GetIntList("IntegerArray").ToArray());
}
Expand Down
26 changes: 13 additions & 13 deletions src/core/Akka.Tests/Configuration/HoconTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void Can_parse_sub_config()
var config = ConfigurationFactory.ParseString(hocon);
var subConfig = config.GetConfig("a");
Assert.Equal(1, subConfig.GetInt("b.c"));
Assert.Equal(true, subConfig.GetBoolean("b.d"));
Assert.True(subConfig.GetBoolean("b.d"));
}


Expand Down Expand Up @@ -153,9 +153,9 @@ public void Can_parse_hocon()
var config = ConfigurationFactory.ParseString(hocon);
Assert.Equal("1", config.GetString("root.int"));
Assert.Equal("1.23", config.GetString("root.double"));
Assert.Equal(true, config.GetBoolean("root.bool"));
Assert.Equal(true, config.GetBoolean("root.object.hasContent"));
Assert.Equal(null, config.GetString("root.null"));
Assert.True(config.GetBoolean("root.bool"));
Assert.True(config.GetBoolean("root.object.hasContent"));
Assert.Null(config.GetString("root.null"));
Assert.Equal("foo", config.GetString("root.quoted-string"));
Assert.Equal("bar", config.GetString("root.unquoted-string"));
Assert.Equal("foo bar", config.GetString("root.concat-string"));
Expand Down Expand Up @@ -188,9 +188,9 @@ public void Can_parse_json()
var config = ConfigurationFactory.ParseString(hocon);
Assert.Equal("1", config.GetString("root.int"));
Assert.Equal("1.23", config.GetString("root.double"));
Assert.Equal(true, config.GetBoolean("root.bool"));
Assert.Equal(true, config.GetBoolean("root.object.hasContent"));
Assert.Equal(null, config.GetString("root.null"));
Assert.True(config.GetBoolean("root.bool"));
Assert.True(config.GetBoolean("root.object.hasContent"));
Assert.Null(config.GetString("root.null"));
Assert.Equal("foo", config.GetString("root.string"));
Assert.True(new[] {1, 2, 3}.SequenceEqual(ConfigurationFactory.ParseString(hocon).GetIntList("root.array")));
}
Expand Down Expand Up @@ -222,7 +222,7 @@ public void Can_override_object()
a.c = 3
";
var config = ConfigurationFactory.ParseString(hocon);
Assert.Equal(null, config.GetString("a.b"));
Assert.Null(config.GetString("a.b"));
Assert.Equal("3", config.GetString("a.c"));
}

Expand Down Expand Up @@ -359,14 +359,14 @@ public void Can_assign_null_to_field()
public void Can_assign_boolean_to_field()
{
var hocon = @"a=true";
Assert.Equal(true, ConfigurationFactory.ParseString(hocon).GetBoolean("a"));
Assert.True(ConfigurationFactory.ParseString(hocon).GetBoolean("a"));
hocon = @"a=false";
Assert.Equal(false, ConfigurationFactory.ParseString(hocon).GetBoolean("a"));
Assert.False(ConfigurationFactory.ParseString(hocon).GetBoolean("a"));

hocon = @"a=on";
Assert.Equal(true, ConfigurationFactory.ParseString(hocon).GetBoolean("a"));
Assert.True(ConfigurationFactory.ParseString(hocon).GetBoolean("a"));
hocon = @"a=off";
Assert.Equal(false, ConfigurationFactory.ParseString(hocon).GetBoolean("a"));
Assert.False(ConfigurationFactory.ParseString(hocon).GetBoolean("a"));
}

[Fact]
Expand Down Expand Up @@ -746,7 +746,7 @@ public void Can_substitute_object()
public void Can_assign_null_string_to_field()
{
var hocon = @"a=null";
Assert.Equal(null, ConfigurationFactory.ParseString(hocon).GetString("a"));
Assert.Null(ConfigurationFactory.ParseString(hocon).GetString("a"));
}

[Fact(Skip = "we currently do not make any distinction between quoted and unquoted strings once parsed")]
Expand Down
Loading