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

Rewrite some legacy tests #385

Merged
merged 5 commits into from
Mar 29, 2024
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
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ dotnet_diagnostic.FAA0004.severity = error # Replace NUnit assertion with Fluen
dotnet_diagnostic.NUnit1001.severity = none # The individual arguments provided by a TestCaseAttribute must match the type of the corresponding parameter of the method
dotnet_diagnostic.NUnit2005.severity = suggestion # Consider using Assert.That(actual, Is.EqualTo(expected)) instead of Assert.AreEqual(expected, actual)
dotnet_diagnostic.NUnit2021.severity = warning # Incompatible types for EqualTo constraint


dotnet_diagnostic.NUnit2005.severity = error # Consider using Assert.That instead of AreEqual
dotnet_diagnostic.NUnit2033.severity = error # Consider using Assert.That instead of NotZero

dotnet_diagnostic.QW0001.severity = none # Use a testable Time Provider
dotnet_diagnostic.QW0010.severity = none # Use DateOnly instead of Date
Expand Down Expand Up @@ -113,7 +113,6 @@ dotnet_diagnostic.S3925.severity = none # "ISerializable" should be implemented
dotnet_diagnostic.S4136.severity = none # Method overloads should be grouped together

dotnet_diagnostic.S1133.severity = suggestion # Deprecated code should be removed
dotnet_diagnostic.S3900.severity = suggestion # Arguments of public methods should be validated against null

dotnet_diagnostic.S107.severity = warning # Methods should not have too many parameters
dotnet_diagnostic.S127.severity = warning # Methods should not have too many parameters
Expand All @@ -136,6 +135,7 @@ dotnet_diagnostic.S3215.severity = warning # Interface instances should not be c
dotnet_diagnostic.S3218.severity = warning # Inner class members should not shadow outer class "static" or type members
dotnet_diagnostic.S3257.severity = warning # Declarations and initializations should be as concise as possible
dotnet_diagnostic.S3776.severity = warning # Cognitive Complexity of methods should not be too high
dotnet_diagnostic.S3900.severity = warning # Arguments of public methods should be validated against null
dotnet_diagnostic.S6354.severity = warning # Use a testable (date) time provider instead

dotnet_diagnostic.VSSpell001.severity = silent # Correct spelling
14 changes: 13 additions & 1 deletion specs/Qowaiv.Specs/Date_span_specs.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Date_span_specs;
using FluentAssertions.Extensions;

namespace Date_span_specs;

public class Is_comparable
{
Expand Down Expand Up @@ -141,6 +143,16 @@ public void plus_does_nothing()
}
}

public class Can_be_added_to
{
[Test]
public void Date_times()
{
var date = 30.January(1999).At(13, 42).AsUtc();
date.Add(DateSpan.FromMonths(1)).Should().Be(28.February(1999).At(13, 42).AsUtc());
}
}

public class Can_create
{
[Test]
Expand Down
2 changes: 1 addition & 1 deletion specs/Qowaiv.Specs/Debug_SVO_specs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void display(Type svoType, object display)
public class Unknown_value : SingleValueObjectSpecs
{
public static IEnumerable<Type> SvosWithDefaultUnknown
=> SvosWithUnknown.Except(new[] { typeof(Sex), typeof(InternetMediaType) });
=> SvosWithUnknown.Except([typeof(Sex), typeof(InternetMediaType)]);

[TestCaseSource(nameof(SvosWithDefaultUnknown))]
public void displays_unknown_for(Type svoType)
Expand Down