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 codestyle issues #1912

Merged
merged 2 commits into from Apr 26, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Src/FluentAssertions/Primitives/EnumAssertions.cs
Expand Up @@ -177,7 +177,7 @@ public AndConstraint<TAssertions> NotBeDefined(string because = "", params objec
.FailWith("but it is.")
.Then
.ClearExpectation();

return new AndConstraint<TAssertions>((TAssertions)this);
}

Expand Down
2 changes: 2 additions & 0 deletions Tests/FluentAssertions.Equivalency.Specs/.editorconfig
Expand Up @@ -127,6 +127,8 @@ dotnet_diagnostic.SA1404.severity = none
dotnet_diagnostic.SA1502.severity = none
# SA1600: Elements should be documented
dotnet_diagnostic.SA1600.severity = none
# SA1601: Partial elements should be documented
dotnet_diagnostic.SA1601.severity = none
# SA1602: Enumeration items should be documented
dotnet_diagnostic.SA1602.severity = none
# SA1611: The documentation for parameter is missing
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluentAssertions.Equivalency.Specs/DataSetSpecs.cs
Expand Up @@ -648,7 +648,7 @@ public void When_data_set_table_count_has_expected_value_equivalence_test_should
// Act & Assert
dataSet.Should().HaveTableCount(correctTableCount);
}

[Fact]
public void Null_data_set_fails()
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluentAssertions.Equivalency.Specs/DataTableSpecs.cs
Expand Up @@ -821,7 +821,7 @@ public void When_data_table_has_expected_column_it_should_succeed()
// Act & Assert
dataTable.Should().HaveColumn(expectedColumnName);
}

[Fact]
public void Null_data_table_has_no_columns_and_fail_the_test()
{
Expand Down
3 changes: 3 additions & 0 deletions Tests/FluentAssertions.Specs/.editorconfig
Expand Up @@ -129,6 +129,8 @@ dotnet_diagnostic.SA1404.severity = none
dotnet_diagnostic.SA1502.severity = none
# SA1600: Elements should be documented
dotnet_diagnostic.SA1600.severity = none
# SA1601: Partial elements should be documented
dotnet_diagnostic.SA1601.severity = none
# SA1602: Enumeration items should be documented
dotnet_diagnostic.SA1602.severity = none
# SA1611: The documentation for parameter is missing
Expand All @@ -139,5 +141,6 @@ dotnet_diagnostic.SA1615.severity = none
# SA1005: Single line comments should begin with single space
dotnet_diagnostic.SA1005.severity = suggestion


# ReSharper/Rider
resharper_expression_is_always_null_highlighting=none
Expand Up @@ -238,7 +238,7 @@ public void When_asserting_collection_contains_values_according_to_predicate_but
"Expected strings to contain (x == \"xxx\") because we're checking how it reacts to a null subject, but found <null>.");
}
}

public class NotContain
{
[Fact]
Expand Down
Expand Up @@ -323,7 +323,7 @@ public void When_asserting_equality_with_a_collection_built_from_params_argument
act.Should().NotThrow();
}
}

public class NotEqual
{
[Fact]
Expand Down
Expand Up @@ -176,7 +176,7 @@ public void When_counting_generic_collection_it_should_not_enumerate()
collection.GetEnumeratorCallCount.Should().Be(0);
}
}

public class NotHaveCount
{
[Fact]
Expand Down
Expand Up @@ -241,7 +241,7 @@ public void When_elements_are_integers_assertion_fails_then_failure_message_must
*Index: 2, Element: 3");
}
}

private class SomeClass
{
public string Text { get; set; }
Expand Down
Expand Up @@ -35,7 +35,7 @@ public void Should_fail_when_asserting_nullable_datetime_value_without_a_value_t
action.Should().Throw<XunitException>();
}
}

public class NotHaveValue
{
[Fact]
Expand Down Expand Up @@ -829,7 +829,7 @@ public void When_asserting_subject_datetime_is_before_the_same_datetime_it_shoul
.WithMessage("Expected subject to be before <2016-06-04>, but found <2016-06-04>.");
}
}

public class NotBeBefore
{
[Fact]
Expand Down Expand Up @@ -875,7 +875,7 @@ public void When_asserting_subject_datetime_is_not_before_the_same_datetime_it_s
act.Should().NotThrow();
}
}

public class BeOnOrBefore
{
[Fact]
Expand Down Expand Up @@ -921,7 +921,7 @@ public void When_asserting_subject_datetime_is_not_on_or_before_earlier_expected
.WithMessage("Expected subject to be on or before <2016-06-03>, but found <2016-06-04>.");
}
}

public class NotBeOnOrBefore
{
[Fact]
Expand Down Expand Up @@ -968,7 +968,7 @@ public void When_asserting_subject_datetime_is_not_on_or_before_earlier_expected
act.Should().NotThrow();
}
}

public class BeAfter
{
[Fact]
Expand Down Expand Up @@ -1015,7 +1015,7 @@ public void When_asserting_subject_datetime_is_after_the_same_expected_datetime_
.WithMessage("Expected subject to be after <2016-06-04>, but found <2016-06-04>.");
}
}

public class NotBeAfter
{
[Fact]
Expand Down
8 changes: 4 additions & 4 deletions Tests/FluentAssertions.Specs/Primitives/EnumAssertionSpecs.cs
Expand Up @@ -260,7 +260,7 @@ public void When_nullable_enums_are_unequal_it_should_throw(MyEnum? subject, MyE
.WithMessage("*because we want to test the failure message*");
}
}

public enum MyEnum
{
One = 1,
Expand Down Expand Up @@ -584,7 +584,7 @@ public void When_nullable_enums_have_equal_names_it_should_throw(MyEnum? subject
.WithMessage("*because we want to test the failure message*");
}
}

public class NotHaveSameNameAs
{
[Fact]
Expand Down Expand Up @@ -643,7 +643,7 @@ public void When_nullable_enums_have_unequal_names_it_should_throw()
.WithMessage("*because we want to test the failure message*");
}
}

public enum MyEnumOtherValue
{
One = 11,
Expand Down Expand Up @@ -710,7 +710,7 @@ public void When_nullable_enum_is_null_it_should_throw()
.WithMessage("*because we want to test the failure message*");
}
}

public class Match
{
[Fact]
Expand Down
Expand Up @@ -955,7 +955,7 @@ public void When_a_system_exception_is_asserted_to_be_serializable_it_should_com
act.Should().NotThrow();
}
}

internal class UnserializableClass
{
public string Name { get; set; }
Expand Down Expand Up @@ -1017,7 +1017,7 @@ public void GetObjectData(SerializationInfo info, StreamingContext context)
info.AddValue("BirthDay", BirthDay);
}
}

public class BeXmlSerializable
{
[Fact]
Expand Down
Expand Up @@ -336,7 +336,7 @@ public void When_string_containment_equivalent_of_at_most_once_is_asserted_and_a
act.Should().NotThrow();
}
}

public class ContainEquivalentOfLessThan
{
[Fact]
Expand Down
Expand Up @@ -73,7 +73,7 @@ public void When_action_runs_indefinitely_it_should_be_stopped_and_throw_if_ther
// Arrange
Action someAction = () =>
{
// lets cause a deadlock
// lets cause a deadlock
var semaphore = new Semaphore(0, 1); // my weapon of choice is a semaphore
semaphore.WaitOne(); // oops
};
Expand Down Expand Up @@ -177,7 +177,7 @@ public void When_action_runs_indefinitely_it_should_be_stopped_and_throw_if_ther
// Arrange
Action someAction = () =>
{
// lets cause a deadlock
// lets cause a deadlock
var semaphore = new Semaphore(0, 1); // my weapon of choice is a semaphore
semaphore.WaitOne(); // oops
};
Expand Down Expand Up @@ -254,7 +254,7 @@ public void When_action_runs_indefinitely_it_should_be_stopped_and_not_throw_if_
// Arrange
Action someAction = () =>
{
// lets cause a deadlock
// lets cause a deadlock
var semaphore = new Semaphore(0, 1); // my weapon of choice is a semaphore
semaphore.WaitOne(); // oops
};
Expand Down Expand Up @@ -330,7 +330,7 @@ public void When_action_runs_indefinitely_it_should_be_stopped_and_not_throw_if_
// Arrange
Action someAction = () =>
{
// lets cause a deadlock
// lets cause a deadlock
var semaphore = new Semaphore(0, 1); // my weapon of choice is a semaphore
semaphore.WaitOne(); // oops
};
Expand Down Expand Up @@ -425,7 +425,7 @@ public void When_action_runs_indefinitely_it_should_be_stopped_and_throw_if_ther
// Arrange
Action someAction = () =>
{
// lets cause a deadlock
// lets cause a deadlock
var semaphore = new Semaphore(0, 1); // my weapon of choice is a semaphore
semaphore.WaitOne(); // oops
};
Expand Down Expand Up @@ -463,8 +463,8 @@ public void Stopwatch_is_not_stopped_after_first_execution_time_assertion()
// Act
Action act = () =>
{
// I know it's not meant to be used like this,
// but since you can, it should still give consistent results
// I know it's not meant to be used like this,
// but since you can, it should still give consistent results
ExecutionTime time = someAction.ExecutionTime();
time.Should().BeGreaterThan(100.Milliseconds());
time.Should().BeGreaterThan(200.Milliseconds());
Expand Down
Expand Up @@ -87,7 +87,7 @@ public void When_asserting_method_return_type_is_null_it_should_throw()
.WithParameterName("returnType");
}
}

public class NotReturn
{
[Fact]
Expand Down
Expand Up @@ -110,7 +110,7 @@ public void When_asserting_a_type_has_an_indexer_with_a_null_parameter_type_list
.WithParameterName("parameterTypes");
}
}

public class NotHaveIndexer
{
[Fact]
Expand Down
Expand Up @@ -74,7 +74,7 @@ public void When_asserting_a_type_to_implement_null_it_should_throw()
.WithParameterName("interfaceType");
}
}

public class ImplementOfT
{
[Fact]
Expand Down
Expand Up @@ -363,7 +363,7 @@ public void When_a_document_is_equivalent_to_null_it_fails()
"Expected theDocument to be equivalent to \"<parent><child /></parent>\" *failure message*" +
", but found <null>.");
}

[Fact]
public void When_assertion_an_xml_document_is_equivalent_to_a_different_xml_document_with_different_namespace_prefix_it_should_succeed()
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluentAssertions.Specs/Xml/XmlNodeAssertionSpecs.cs
Expand Up @@ -173,7 +173,7 @@ public void When_asserting_a_null_xml_node_is_not_null_it_should_fail_with_descr
.WithMessage("Expected theDocument not to be <null> because we want to test the failure message.");
}
}

public class BeEquivalentTo
{
[Fact]
Expand Down