Skip to content

Commit

Permalink
Upgrade NuGet packages (#1670)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma authored Nov 4, 2023
1 parent 8015e77 commit aacc233
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.13.9" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.10" />
<PackageVersion Include="Esprima" Version="3.0.1" />
<PackageVersion Include="Flurl.Http.Signed" Version="3.2.4" />
<PackageVersion Include="Jurassic" Version="3.2.6" />
<PackageVersion Include="Jurassic" Version="3.2.7" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="MongoDB.Bson.signed" Version="2.19.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NiL.JS" Version="2.5.1674" />
<PackageVersion Include="NodaTime" Version="3.1.9" />
<PackageVersion Include="NUnit" Version="3.13.3" />
<PackageVersion Include="NUnit" Version="3.14.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageVersion Include="SharpZipLib" Version="1.4.0" />
<PackageVersion Include="Spectre.Console.Cli" Version="0.45.0" />
<PackageVersion Include="System.Text.Json" Version="6.0.8" />
<PackageVersion Include="Test262Harness" Version="0.0.22" />
<PackageVersion Include="xunit" Version="2.5.3" />
<PackageVersion Include="xunit" Version="2.6.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageVersion Include="YantraJS.Core" Version="1.2.196" />
<PackageVersion Include="YantraJS.Core" Version="1.2.201" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
Expand Down
58 changes: 54 additions & 4 deletions Jint.Tests/Runtime/Domain/Dimensional.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Jint.Tests.Runtime.Domain
{
public class Dimensional : IComparable<Dimensional>
public class Dimensional : IComparable<Dimensional>, IEquatable<Dimensional>
{
private readonly MeasureUnit[] PossibleMeasureUnits = new MeasureUnit[] { new MeasureUnit("Mass", "kg", 1.0), new MeasureUnit("Mass", "gr", 0.001), new MeasureUnit("Count", "piece", 1.0) };

Expand Down Expand Up @@ -47,19 +47,69 @@ public override string ToString()
{
return Value + " " + MeasureUnit.Name;
}

public bool Equals(Dimensional other)
{
if (ReferenceEquals(null, other))
{
return false;
}

if (ReferenceEquals(this, other))
{
return true;
}

return Value.Equals(other.Value) && Equals(MeasureUnit, other.MeasureUnit);
}

public override bool Equals(object obj)
{
return Equals(obj as Dimensional);
}

public override int GetHashCode()
{
return Value.GetHashCode();
}
}

public class MeasureUnit
public class MeasureUnit : IEquatable<MeasureUnit>
{
public string MeasureType { get; set; }
public string Name { get; set; }
public double RelativeValue { get; set; }

public MeasureUnit(string measureType, string Name, double relativeValue)
public MeasureUnit(string measureType, string name, double relativeValue)
{
this.MeasureType = measureType;
this.Name = Name;
this.Name = name;
this.RelativeValue = relativeValue;
}

public bool Equals(MeasureUnit other)
{
if (ReferenceEquals(null, other))
{
return false;
}

if (ReferenceEquals(this, other))
{
return true;
}

return MeasureType == other.MeasureType && Name == other.Name && RelativeValue.Equals(other.RelativeValue);
}

public override bool Equals(object obj)
{
return Equals(obj as MeasureUnit);
}

public override int GetHashCode()
{
return MeasureType.GetHashCode() ^ Name.GetHashCode() ^ RelativeValue.GetHashCode();
}
}
}

0 comments on commit aacc233

Please sign in to comment.