Skip to content

Commit

Permalink
Using var for lamdas
Browse files Browse the repository at this point in the history
  • Loading branch information
IT-VBFK authored and IT-VBFK committed Aug 13, 2023
1 parent 4c8a05f commit b7cac32
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
Expand Up @@ -2476,7 +2476,7 @@ public void Should_throw_a_helpful_error_when_accidentally_using_equals_with_a_r
DateTimeOffset someDateTimeOffset = new(2022, 9, 25, 13, 48, 42, 0, TimeSpan.Zero);

// Act
Func<bool> action = () => someDateTimeOffset.Should().BeLessThan(0.Seconds()).Equals(someDateTimeOffset);
var action = () => someDateTimeOffset.Should().BeLessThan(0.Seconds()).Equals(someDateTimeOffset);

// Assert
action.Should().Throw<NotSupportedException>()
Expand Down Expand Up @@ -2587,7 +2587,7 @@ public void Should_throw_a_helpful_error_when_accidentally_using_equals()
DateTimeOffset someDateTimeOffset = new(2022, 9, 25, 13, 48, 42, 0, TimeSpan.Zero);

// Act
Func<bool> action = () => someDateTimeOffset.Should().Equals(someDateTimeOffset);
var action = () => someDateTimeOffset.Should().Equals(someDateTimeOffset);

// Assert
action.Should().Throw<NotSupportedException>()
Expand Down
Expand Up @@ -896,7 +896,7 @@ public void Should_throw_a_helpful_error_when_accidentally_using_equals()
MyEnum? subject = null;

// Act
Func<bool> action = () => subject.Should().Equals(subject);
var action = () => subject.Should().Equals(subject);

// Assert
action.Should().Throw<NotSupportedException>()
Expand Down
Expand Up @@ -1243,7 +1243,7 @@ public void Should_throw_a_helpful_error_when_accidentally_using_equals()
var someObject = new Exception();

// Act
Func<bool> action = () => someObject.Should().Equals(someObject);
var action = () => someObject.Should().Equals(someObject);

// Assert
action.Should().Throw<NotSupportedException>()
Expand Down
Expand Up @@ -1386,7 +1386,7 @@ public void Should_throw_a_helpful_error_when_accidentally_using_equals()
TimeOnly someTimeOnly = new(21, 1);

// Act
Func<bool> act = () => someTimeOnly.Should().Equals(someTimeOnly);
var act = () => someTimeOnly.Should().Equals(someTimeOnly);

// Assert
act.Should().Throw<NotSupportedException>()
Expand Down
Expand Up @@ -598,7 +598,7 @@ public void When_asserting_execution_time_of_null_action_it_should_throw()
object subject = null;

// Act
Func<AndConstraint<ExecutionTimeAssertions>> act = () => subject.ExecutionTimeOf(s => s.ToString()).Should().BeLessThan(1.Days());
var act = () => subject.ExecutionTimeOf(s => s.ToString()).Should().BeLessThan(1.Days());

// Assert
act.Should().ThrowExactly<ArgumentNullException>()
Expand Down Expand Up @@ -626,7 +626,7 @@ public void When_accidentally_using_equals_it_should_throw_a_helpful_error()
var subject = new object();

// Act
Func<bool> act = () => subject.ExecutionTimeOf(s => s.ToString()).Should().Equals(1.Seconds());
var act = () => subject.ExecutionTimeOf(s => s.ToString()).Should().Equals(1.Seconds());

// Assert
act.Should().Throw<NotSupportedException>().WithMessage(
Expand Down
4 changes: 2 additions & 2 deletions Tests/FluentAssertions.Specs/Types/MethodInfoSelectorSpecs.cs
Expand Up @@ -45,7 +45,7 @@ public void When_method_info_selector_is_null_then_should_should_throw()
MethodInfoSelector methodInfoSelector = null;

// Act
Func<MethodInfoSelectorAssertions> act = () => methodInfoSelector.Should();
var act = () => methodInfoSelector.Should();

// Assert
act.Should().ThrowExactly<ArgumentNullException>()
Expand Down Expand Up @@ -433,7 +433,7 @@ public void When_accidentally_using_equals_it_should_throw_a_helpful_error()
Type type = typeof(TestClassForMethodSelector);

// Act
Func<bool> action = () => type.Methods().Should().Equals(null);
var action = () => type.Methods().Should().Equals(null);

// Assert
action.Should().Throw<NotSupportedException>()
Expand Down
Expand Up @@ -16,7 +16,7 @@ public void When_asserting_properties_are_virtual_and_they_are_it_should_succeed
var propertyInfoSelector = new PropertyInfoSelector(typeof(ClassWithAllPropertiesVirtual));

// Act
Func<AndConstraint<PropertyInfoSelectorAssertions>> act = () =>
var act = () =>
propertyInfoSelector.Should().BeVirtual();

// Assert
Expand Down Expand Up @@ -298,7 +298,7 @@ public void When_accidentally_using_equals_it_should_throw_a_helpful_error()
var someObject = new PropertyInfoSelectorAssertions();

// Act
Func<bool> action = () => someObject.Equals(someObject);
var action = () => someObject.Equals(someObject);

// Assert
action.Should().Throw<NotSupportedException>()
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluentAssertions.Specs/Types/TypeSelectorSpecs.cs
Expand Up @@ -55,7 +55,7 @@ public void When_type_selector_is_null_then_should_should_throw()
TypeSelector propertyInfoSelector = null;

// Act
Func<TypeSelectorAssertions> act = () => propertyInfoSelector.Should();
var act = () => propertyInfoSelector.Should();

// Assert
act.Should().ThrowExactly<ArgumentNullException>()
Expand Down

0 comments on commit b7cac32

Please sign in to comment.