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

Release/1.4.17 #6

Closed
wants to merge 6 commits into from
Closed
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/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<PackageOutputPath>$(MSBuildThisFileDirectory)..\artifacts</PackageOutputPath>
<version>1.4.15-rc.3</version>
<version>1.4.17</version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.AspNetCore.Mvc.ApiExplorer" Version="2.2.0" />
<PackageReference Include="System.Text.Json" Version="8.0.2" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard2.0' ">
Expand Down
15 changes: 11 additions & 4 deletions src/Primitively/EmbeddedResources/Integer/Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,30 @@
{
private readonly global::PRIMITIVE_VALUE_TYPE _value = default;

public const string Example = @"PRIMITIVE_EXAMPLE";
public const string Example = "PRIMITIVE_EXAMPLE";
public const global::PRIMITIVE_VALUE_TYPE Minimum = PRIMITIVE_MINIMUM;
public const global::PRIMITIVE_VALUE_TYPE Maximum = PRIMITIVE_MAXIMUM;

public PRIMITIVE_TYPE()
{
HasValue = _value >= Minimum && _value <= Maximum;
}

public PRIMITIVE_TYPE(global::PRIMITIVE_VALUE_TYPE value)
{
if (value >= PRIMITIVE_MINIMUM && value <= PRIMITIVE_MAXIMUM)
if (value >= Minimum && value <= Maximum)
{
_value = value;
HasValue = true;
}
}

private PRIMITIVE_TYPE(string value)
{
if (global::PRIMITIVE_VALUE_TYPE.TryParse(value, out var result) && result >= PRIMITIVE_MINIMUM && result <= PRIMITIVE_MAXIMUM)
if (global::PRIMITIVE_VALUE_TYPE.TryParse(value, out var result) && result >= Minimum && result <= Maximum)
{
_value = result;
HasValue = true;
}
}

Expand All @@ -27,7 +34,7 @@ private PRIMITIVE_TYPE(string value)
global::PRIMITIVE_VALUE_TYPE global::Primitively.IPrimitive<global::PRIMITIVE_VALUE_TYPE>.Value => _value;

[global::System.Text.Json.Serialization.JsonIgnore]
public bool HasValue => _value != default;
public bool HasValue { get; } = false;

[global::System.Text.Json.Serialization.JsonIgnore]
public global::System.Type ValueType => typeof(global::PRIMITIVE_VALUE_TYPE);
Expand Down
2 changes: 1 addition & 1 deletion test/Acme.TestLib/Acme.TestLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="8.0.2" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion test/Acme.TestLib2/Acme.TestLib2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="8.0.2" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public FluentValidationTests()
[InlineData("")]
[InlineData(" ")]
[InlineData(" ")]
[InlineData("0")]
[InlineData("00")]
[InlineData("-1")]
[InlineData("0", true, true)]
[InlineData("00", true, true)]
[InlineData("001", true, true)]
[InlineData(ByteId.Example, true, true)]
public void ConvertFromThisToThatWithExpectedResults(string? value, bool nonNullableIsValid = false, bool nullableIsValid = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,15 @@ public class InstantiationTests
[InlineData("")]
[InlineData(" ")]
[InlineData(" ")]
[InlineData("0")]
[InlineData("00")]
[InlineData("-1")]
[InlineData("0", true)]
[InlineData("00", true)]
[InlineData("001", true)]
[InlineData(ByteId.Example, true)]
public void ConvertFromThisToThatWithExpectedResults(string? from, bool hasValue = default)
public void ConvertFromThisToThatWithExpectedResults(string? from, bool hasValue = false)
{
var expectedInteger = hasValue ? ByteId.Parse(from) : default;
var expectedString = expectedInteger.ToString();

var @this = (ByteId)from;
string to = @this;
var that = ByteId.Parse(to);
var and = new ByteId(that);
string back = and;
var @this = ByteId.Parse(from);

@this.HasValue.Should().Be(hasValue);
@this.Should().Be(expectedInteger);
@this.ToString().Should().Be(expectedString);
to.Should().Be(expectedString);
that.HasValue.Should().Be(hasValue);
that.Should().Be(expectedInteger);
that.ToString().Should().Be(expectedString);
and.HasValue.Should().Be(hasValue);
and.Should().Be(expectedInteger);
and.ToString().Should().Be(expectedString);
back.Should().Be(expectedString);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public FluentValidationTests()
[InlineData("")]
[InlineData(" ")]
[InlineData(" ")]
[InlineData("0")]
[InlineData("00")]
[InlineData("-1", true, true)]
[InlineData("0", true, true)]
[InlineData("00", true, true)]
[InlineData("001", true, true)]
[InlineData(IntId.Example, true, true)]
public void ConvertFromThisToThatWithExpectedResults(string? value, bool nonNullableIsValid = false, bool nullableIsValid = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,15 @@ public class InstantiationTests
[InlineData("")]
[InlineData(" ")]
[InlineData(" ")]
[InlineData("0")]
[InlineData("00")]
[InlineData("-1", true)]
[InlineData("0", true)]
[InlineData("00", true)]
[InlineData("001", true)]
[InlineData(IntId.Example, true)]
public void ConvertFromThisToThatWithExpectedResults(string? from, bool hasValue = default)
public void ConvertFromThisToThatWithExpectedResults(string? from, bool hasValue = false)
{
var expectedInteger = hasValue ? IntId.Parse(from) : default;
var expectedString = expectedInteger.ToString();

var @this = (IntId)from;
string to = @this;
var that = IntId.Parse(to);
var and = new IntId(that);
string back = and;
var @this = IntId.Parse(from);

@this.HasValue.Should().Be(hasValue);
@this.Should().Be(expectedInteger);
@this.ToString().Should().Be(expectedString);
to.Should().Be(expectedString);
that.HasValue.Should().Be(hasValue);
that.Should().Be(expectedInteger);
that.ToString().Should().Be(expectedString);
and.HasValue.Should().Be(hasValue);
and.Should().Be(expectedInteger);
and.ToString().Should().Be(expectedString);
back.Should().Be(expectedString);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ public class ValidateMethodTests
[InlineData("")]
[InlineData(" ")]
[InlineData(" ")]
[InlineData("0")]
[InlineData("00")]
[InlineData("-1", true)]
[InlineData("0", true)]
[InlineData("00", true)]
[InlineData("001", true)]
[InlineData(ValidatableInteger.Example, true)]
public void ConvertFromThisToThatWithExpectedResults(string? value, bool isValid = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public FluentValidationTests()
[InlineData("")]
[InlineData(" ")]
[InlineData(" ")]
[InlineData("0")]
[InlineData("00")]
[InlineData("-1", true, true)]
[InlineData("0", true, true)]
[InlineData("00", true, true)]
[InlineData("001", true, true)]
[InlineData(LongId.Example, true, true)]
public void ConvertFromThisToThatWithExpectedResults(string? value, bool nonNullableIsValid = false, bool nullableIsValid = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,15 @@ public class InstantiationTests
[InlineData("")]
[InlineData(" ")]
[InlineData(" ")]
[InlineData("0")]
[InlineData("00")]
[InlineData("-1", true)]
[InlineData("0", true)]
[InlineData("00", true)]
[InlineData("001", true)]
[InlineData(LongId.Example, true)]
public void ConvertFromThisToThatWithExpectedResults(string? from, bool hasValue = default)
public void ConvertFromThisToThatWithExpectedResults(string? from, bool hasValue = false)
{
var expectedInteger = hasValue ? LongId.Parse(from) : default;
var expectedString = expectedInteger.ToString();

var @this = (LongId)from;
string to = @this;
var that = LongId.Parse(to);
var and = new LongId(that);
string back = and;
var @this = LongId.Parse(from);

@this.HasValue.Should().Be(hasValue);
@this.Should().Be(expectedInteger);
@this.ToString().Should().Be(expectedString);
to.Should().Be(expectedString);
that.HasValue.Should().Be(hasValue);
that.Should().Be(expectedInteger);
that.ToString().Should().Be(expectedString);
and.HasValue.Should().Be(hasValue);
and.Should().Be(expectedInteger);
and.ToString().Should().Be(expectedString);
back.Should().Be(expectedString);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public FluentValidationTests()
[InlineData("")]
[InlineData(" ")]
[InlineData(" ")]
[InlineData("0")]
[InlineData("00")]
[InlineData("-1", true, true)]
[InlineData("0", true, true)]
[InlineData("00", true, true)]
[InlineData("001", true, true)]
[InlineData(SByteId.Example, true, true)]
public void ConvertFromThisToThatWithExpectedResults(string? value, bool nonNullableIsValid = false, bool nullableIsValid = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,15 @@ public class InstantiationTests
[InlineData("")]
[InlineData(" ")]
[InlineData(" ")]
[InlineData("0")]
[InlineData("00")]
[InlineData("-1", true)]
[InlineData("0", true)]
[InlineData("00", true)]
[InlineData("001", true)]
[InlineData(SByteId.Example, true)]
public void ConvertFromThisToThatWithExpectedResults(string? from, bool hasValue = default)
public void ConvertFromThisToThatWithExpectedResults(string? from, bool hasValue = false)
{
var expectedInteger = hasValue ? SByteId.Parse(from) : default;
var expectedString = expectedInteger.ToString();

var @this = (SByteId)from;
string to = @this;
var that = SByteId.Parse(to);
var and = new SByteId(that);
string back = and;
var @this = SByteId.Parse(from);

@this.HasValue.Should().Be(hasValue);
@this.Should().Be(expectedInteger);
@this.ToString().Should().Be(expectedString);
to.Should().Be(expectedString);
that.HasValue.Should().Be(hasValue);
that.Should().Be(expectedInteger);
that.ToString().Should().Be(expectedString);
and.HasValue.Should().Be(hasValue);
and.Should().Be(expectedInteger);
and.ToString().Should().Be(expectedString);
back.Should().Be(expectedString);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public FluentValidationTests()
[InlineData("")]
[InlineData(" ")]
[InlineData(" ")]
[InlineData("0")]
[InlineData("00")]
[InlineData("-1", true, true)]
[InlineData("0", true, true)]
[InlineData("00", true, true)]
[InlineData("001", true, true)]
[InlineData(ShortId.Example, true, true)]
public void ConvertFromThisToThatWithExpectedResults(string? value, bool nonNullableIsValid = false, bool nullableIsValid = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,15 @@ public class InstantiationTests
[InlineData("")]
[InlineData(" ")]
[InlineData(" ")]
[InlineData("0")]
[InlineData("00")]
[InlineData("-1", true)]
[InlineData("0", true)]
[InlineData("00", true)]
[InlineData("001", true)]
[InlineData(ShortId.Example, true)]
public void ConvertFromThisToThatWithExpectedResults(string? from, bool hasValue = default)
public void ConvertFromThisToThatWithExpectedResults(string? from, bool hasValue = false)
{
var expectedInteger = hasValue ? ShortId.Parse(from) : default;
var expectedString = expectedInteger.ToString();

var @this = (ShortId)from;
string to = @this;
var that = ShortId.Parse(to);
var and = new ShortId(that);
string back = and;
var @this = ShortId.Parse(from);

@this.HasValue.Should().Be(hasValue);
@this.Should().Be(expectedInteger);
@this.ToString().Should().Be(expectedString);
to.Should().Be(expectedString);
that.HasValue.Should().Be(hasValue);
that.Should().Be(expectedInteger);
that.ToString().Should().Be(expectedString);
and.HasValue.Should().Be(hasValue);
and.Should().Be(expectedInteger);
and.ToString().Should().Be(expectedString);
back.Should().Be(expectedString);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public FluentValidationTests()
[InlineData("")]
[InlineData(" ")]
[InlineData(" ")]
[InlineData("0")]
[InlineData("00")]
[InlineData("-1")]
[InlineData("0", true, true)]
[InlineData("00", true, true)]
[InlineData("001", true, true)]
[InlineData(UIntId.Example, true, true)]
public void ConvertFromThisToThatWithExpectedResults(string? value, bool nonNullableIsValid = false, bool nullableIsValid = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,15 @@ public class InstantiationTests
[InlineData("")]
[InlineData(" ")]
[InlineData(" ")]
[InlineData("0")]
[InlineData("00")]
[InlineData("-1")]
[InlineData("0", true)]
[InlineData("00", true)]
[InlineData("001", true)]
[InlineData(UIntId.Example, true)]
public void ConvertFromThisToThatWithExpectedResults(string? from, bool hasValue = default)
public void ConvertFromThisToThatWithExpectedResults(string? from, bool hasValue = false)
{
var expectedInteger = hasValue ? UIntId.Parse(from) : default;
var expectedString = expectedInteger.ToString();

var @this = (UIntId)from;
string to = @this;
var that = UIntId.Parse(to);
var and = new UIntId(that);
string back = and;
var @this = UIntId.Parse(from);

@this.HasValue.Should().Be(hasValue);
@this.Should().Be(expectedInteger);
@this.ToString().Should().Be(expectedString);
to.Should().Be(expectedString);
that.HasValue.Should().Be(hasValue);
that.Should().Be(expectedInteger);
that.ToString().Should().Be(expectedString);
and.HasValue.Should().Be(hasValue);
and.Should().Be(expectedInteger);
and.ToString().Should().Be(expectedString);
back.Should().Be(expectedString);
}
}
Loading
Loading