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 TimeSpan extensions to be plural #703

Merged
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
4 changes: 2 additions & 2 deletions Src/FluentAssertions/Extensions/FluentDateTimeExtensions.cs
Expand Up @@ -240,7 +240,7 @@ public static DateTime After(this TimeSpan timeDifference, DateTime sourceDateTi
/// </summary>
public static int Nanosecond(this DateTime self)
{
return self.Ticks.Ticks().Nanosecond();
return self.Ticks.Ticks().Nanoseconds();
}

/// <summary>
Expand All @@ -261,7 +261,7 @@ public static DateTime AddNanoseconds(this DateTime self, long nanoseconds)
/// </summary>
public static int Microsecond(this DateTime self)
{
return self.Ticks.Ticks().Microsecond();
return self.Ticks.Ticks().Microseconds();
}

/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions Src/FluentAssertions/Extensions/FluentTimeSpanExtensions.cs
Expand Up @@ -50,7 +50,7 @@ public static TimeSpan Ticks(this long ticks)
/// <summary>
/// Gets the nanoseconds component of the time interval represented by the current <see cref="TimeSpan" /> structure.
/// </summary>
public static int Nanosecond(this TimeSpan self)
public static int Nanoseconds(this TimeSpan self)
{
return (int)((self.Ticks % TicksPerMicrosecond) * (1d / TicksPerNanosecond));
}
Expand Down Expand Up @@ -88,11 +88,11 @@ public static double TotalNanoseconds(this TimeSpan self)
{
return self.Ticks * (1d / TicksPerNanosecond);
}

/// <summary>
/// Gets the microseconds component of the time interval represented by the current <see cref="TimeSpan" /> structure.
/// </summary>
public static int Microsecond(this TimeSpan self)
public static int Microseconds(this TimeSpan self)
{
return (int)((self.Ticks % TimeSpan.TicksPerMillisecond) * (1d / TicksPerMicrosecond));
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/Shared.Specs/TimeSpanConversionExtensionSpecs.cs
Expand Up @@ -131,7 +131,7 @@ public void When_getting_the_nanoseconds_component_it_should_return_the_correct_
//-----------------------------------------------------------------------------------------------------------
// Act
//-----------------------------------------------------------------------------------------------------------
var value = time.Nanosecond();
var value = time.Nanoseconds();

//-----------------------------------------------------------------------------------------------------------
// Assert
Expand Down Expand Up @@ -197,7 +197,7 @@ public void When_getting_the_microseconds_component_it_should_return_the_correct
//-----------------------------------------------------------------------------------------------------------
// Act
//-----------------------------------------------------------------------------------------------------------
var value = time.Microsecond();
var value = time.Microseconds();

//-----------------------------------------------------------------------------------------------------------
// Assert
Expand Down