Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on: [push, pull_request]

jobs:
build:
runs-on: windows-2019
runs-on: windows-2025
steps:
- uses: actions/checkout@v1
- name: Setup .NetCore
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.100
dotnet-version: 10.0.100
- name: Build with dotnet
run: |
dotnet build -c Release
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ operating XTMF2.

### Requirements

1. DotNet Core 6.0+ SDK
1. DotNet Core 10.0+ SDK

### Clone the XTMF2 repository

Expand Down
3 changes: 1 addition & 2 deletions src/XTMF2.Client/XTMF2.RunServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>XTMF2.RunServer</RootNamespace>
<ApplicationIcon />
<OutputTypeEx>exe</OutputTypeEx>
Expand All @@ -11,7 +11,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.IO.Pipes" Version="4.3.0" />
<Content Include="..\..\src\XTMF2.Run\bin\$(Configuration)\$(TargetFramework)\XTMF2.Run.deps.json" Link="XTMF2.Run.deps.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
2 changes: 1 addition & 1 deletion src/XTMF2.Interfaces/XTMF2.Interfaces.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>XTMF2</RootNamespace>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/XTMF2.Run/XTMF2.Run.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
8 changes: 1 addition & 7 deletions src/XTMF2/XTMF2.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageProjectUrl></PackageProjectUrl>
<RepositoryUrl>https://github.com/TravelModellingGroup/XTMF2.git</RepositoryUrl>
Expand All @@ -12,12 +12,6 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="System.Threading.Tasks.Parallel" Version="4.3.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\XTMF2.Interfaces\XTMF2.Interfaces.csproj" />
</ItemGroup>
Expand Down
68 changes: 34 additions & 34 deletions tests/XTMF2.UnitTests/Editing/TestBoundaries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ public void AddBoundary()
{
var ms = mSession.ModelSystem;
CommandError error = null;
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.IsEmpty(ms.GlobalBoundary.Boundaries);
Assert.IsTrue(mSession.AddBoundary(user, ms.GlobalBoundary, "UniqueName", out Boundary subB, out error), error?.Message);
Assert.IsFalse(mSession.AddBoundary(user, ms.GlobalBoundary, "UniqueName", out Boundary fail1, out error), "Created a second boundary with the same name!");
Assert.AreEqual(1, ms.GlobalBoundary.Boundaries.Count);
Assert.HasCount(1, ms.GlobalBoundary.Boundaries);
Assert.IsTrue(mSession.Undo(user, out error), error?.Message);
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.HasCount(0, ms.GlobalBoundary.Boundaries);
Assert.IsTrue(mSession.Redo(user, out error), error?.Message);
Assert.AreEqual(1, ms.GlobalBoundary.Boundaries.Count);
Assert.HasCount(1, ms.GlobalBoundary.Boundaries);
Assert.AreSame(subB, ms.GlobalBoundary.Boundaries[0]);
Assert.IsFalse(mSession.AddBoundary(user, ms.GlobalBoundary, "UniqueName", out Boundary fail2, out error), "Created a second boundary with the same name after redo!");
});
Expand All @@ -52,7 +52,7 @@ public void AddBoundaryWithBadUser()
TestHelper.RunInModelSystemContext("AddBoundaryWithBadUser", (user, unauthorizedUser, pSession, mSession) =>
{
var ms = mSession.ModelSystem;
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.IsEmpty(ms.GlobalBoundary.Boundaries);
Assert.IsFalse(mSession.AddBoundary(unauthorizedUser, ms.GlobalBoundary, "UniqueName", out Boundary subB, out var error), error?.Message);
});
}
Expand All @@ -63,8 +63,8 @@ public void AddBoundaryNullParent()
TestHelper.RunInModelSystemContext("AddBoundaryNullParent", (user, pSession, mSession) =>
{
var ms = mSession.ModelSystem;
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.ThrowsException<ArgumentNullException>(() =>
Assert.IsEmpty(ms.GlobalBoundary.Boundaries);
Assert.Throws<ArgumentNullException>(() =>
{
mSession.AddBoundary(user, null, "UniqueName", out Boundary subB, out var error);
});
Expand All @@ -77,8 +77,8 @@ public void AddBoundaryNulUser()
TestHelper.RunInModelSystemContext("AddBoundaryNullUser", (user, pSession, mSession) =>
{
var ms = mSession.ModelSystem;
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.ThrowsException<ArgumentNullException>(() =>
Assert.IsEmpty(ms.GlobalBoundary.Boundaries);
Assert.Throws<ArgumentNullException>(() =>
{
mSession.AddBoundary(null, ms.GlobalBoundary, "UniqueName", out Boundary subB, out var error);
});
Expand All @@ -91,25 +91,25 @@ public void RemoveBoundary()
TestHelper.RunInModelSystemContext("RemoveBoundary", (user, pSession, mSession) =>
{
var ms = mSession.ModelSystem;
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.IsEmpty(ms.GlobalBoundary.Boundaries);
Assert.IsTrue(mSession.AddBoundary(user, ms.GlobalBoundary, "UniqueName", out Boundary subB, out var error), error?.Message);
Assert.IsFalse(mSession.AddBoundary(user, ms.GlobalBoundary, "UniqueName", out Boundary fail1, out error), "Created a second boundary with the same name!");
Assert.AreEqual(1, ms.GlobalBoundary.Boundaries.Count);
Assert.HasCount(1, ms.GlobalBoundary.Boundaries);
Assert.IsTrue(mSession.Undo(user, out error), error?.Message);
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.HasCount(0, ms.GlobalBoundary.Boundaries);
Assert.IsTrue(mSession.Redo(user, out error), error?.Message);
Assert.AreEqual(1, ms.GlobalBoundary.Boundaries.Count);
Assert.HasCount(1, ms.GlobalBoundary.Boundaries);
Assert.AreSame(subB, ms.GlobalBoundary.Boundaries[0]);
Assert.IsFalse(mSession.AddBoundary(user, ms.GlobalBoundary, "UniqueName", out Boundary fail2, out error), "Created a second boundary with the same name after redo!");

// Now test removing the boundary explicitly
Assert.IsTrue(mSession.RemoveBoundary(user, ms.GlobalBoundary, subB, out error), error?.Message);
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.IsEmpty(ms.GlobalBoundary.Boundaries);
Assert.IsTrue(mSession.Undo(user, out error), error?.Message);
Assert.AreEqual(1, ms.GlobalBoundary.Boundaries.Count);
Assert.HasCount(1, ms.GlobalBoundary.Boundaries);
Assert.AreSame(subB, ms.GlobalBoundary.Boundaries[0]);
Assert.IsTrue(mSession.Redo(user, out error), error?.Message);
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.IsEmpty(ms.GlobalBoundary.Boundaries);
});
}

Expand All @@ -120,21 +120,21 @@ public void RemoveBoundaryWithBadUser()
{
var ms = mSession.ModelSystem;
CommandError error = null;
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.IsEmpty(ms.GlobalBoundary.Boundaries);
Assert.IsTrue(mSession.AddBoundary(user, ms.GlobalBoundary, "UniqueName", out Boundary subB, out error), error?.Message);
Assert.IsFalse(mSession.AddBoundary(user, ms.GlobalBoundary, "UniqueName", out Boundary fail1, out error), "Created a second boundary with the same name!");
Assert.AreEqual(1, ms.GlobalBoundary.Boundaries.Count);
Assert.HasCount(1, ms.GlobalBoundary.Boundaries);
Assert.IsTrue(mSession.Undo(user, out error), error?.Message);
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.IsEmpty(ms.GlobalBoundary.Boundaries);
Assert.IsTrue(mSession.Redo(user, out error), error?.Message);
Assert.AreEqual(1, ms.GlobalBoundary.Boundaries.Count);
Assert.HasCount(1, ms.GlobalBoundary.Boundaries);
Assert.AreSame(subB, ms.GlobalBoundary.Boundaries[0]);
Assert.IsFalse(mSession.AddBoundary(user, ms.GlobalBoundary, "UniqueName", out Boundary fail2, out error), "Created a second boundary with the same name after redo!");

// Now test removing the boundary explicitly
Assert.AreEqual(1, ms.GlobalBoundary.Boundaries.Count);
Assert.HasCount(1, ms.GlobalBoundary.Boundaries);
Assert.IsFalse(mSession.RemoveBoundary(unauthorizedUser, ms.GlobalBoundary, subB, out error), error?.Message);
Assert.AreEqual(1, ms.GlobalBoundary.Boundaries.Count);
Assert.HasCount(1, ms.GlobalBoundary.Boundaries);
});
}

Expand All @@ -144,12 +144,12 @@ public void RemoveBoundaryNullBoundary()
TestHelper.RunInModelSystemContext("RemoveBoundary", (user, pSession, mSession) =>
{
var ms = mSession.ModelSystem;
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.IsEmpty(ms.GlobalBoundary.Boundaries);
Assert.IsTrue(mSession.AddBoundary(user, ms.GlobalBoundary, "UniqueName", out Boundary subB, out var error), error?.Message);
Assert.AreEqual(1, ms.GlobalBoundary.Boundaries.Count);
Assert.HasCount(1, ms.GlobalBoundary.Boundaries);

// Now test removing the boundary explicitly
Assert.ThrowsException<ArgumentNullException>(() =>
Assert.Throws<ArgumentNullException>(() =>
{
mSession.RemoveBoundary(user, ms.GlobalBoundary, null, out error);
});
Expand All @@ -162,12 +162,12 @@ public void RemoveBoundaryNullParent()
TestHelper.RunInModelSystemContext("RemoveBoundary", (user, pSession, mSession) =>
{
var ms = mSession.ModelSystem;
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.IsEmpty(ms.GlobalBoundary.Boundaries);
Assert.IsTrue(mSession.AddBoundary(user, ms.GlobalBoundary, "UniqueName", out Boundary subB, out var error), error?.Message);
Assert.AreEqual(1, ms.GlobalBoundary.Boundaries.Count);
Assert.HasCount(1, ms.GlobalBoundary.Boundaries);

// Now test removing the boundary explicitly
Assert.ThrowsException<ArgumentNullException>(() =>
Assert.Throws<ArgumentNullException>(() =>
{
mSession.RemoveBoundary(user, null, subB, out error);
});
Expand All @@ -181,12 +181,12 @@ public void RemoveBoundaryNullUser()
{
var ms = mSession.ModelSystem;
CommandError error = null;
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.IsEmpty(ms.GlobalBoundary.Boundaries);
Assert.IsTrue(mSession.AddBoundary(user, ms.GlobalBoundary, "UniqueName", out Boundary subB, out error), error?.Message);
Assert.AreEqual(1, ms.GlobalBoundary.Boundaries.Count);
Assert.HasCount(1, ms.GlobalBoundary.Boundaries);

// Now test removing the boundary explicitly
Assert.ThrowsException<ArgumentNullException>(() =>
Assert.Throws<ArgumentNullException>(() =>
{
mSession.RemoveBoundary(null, ms.GlobalBoundary, subB, out error);
});
Expand All @@ -200,12 +200,12 @@ public void RemoveBoundaryNotInBoundary()
{
var ms = mSession.ModelSystem;
CommandError error = null;
Assert.AreEqual(0, ms.GlobalBoundary.Boundaries.Count);
Assert.IsEmpty(ms.GlobalBoundary.Boundaries);
Assert.IsTrue(mSession.AddBoundary(user, ms.GlobalBoundary, "SubB", out Boundary subB, out error), error?.Message);
Assert.IsTrue(mSession.AddBoundary(user, ms.GlobalBoundary, "SubC", out Boundary subC, out error), error?.Message);
Assert.IsTrue(mSession.AddBoundary(user, subC, "SubCA", out Boundary subCA, out error), error?.Message);
Assert.AreEqual(2, ms.GlobalBoundary.Boundaries.Count);
Assert.AreEqual(1, subC.Boundaries.Count);
Assert.HasCount(2, ms.GlobalBoundary.Boundaries);
Assert.HasCount(1, subC.Boundaries);

Assert.IsFalse(mSession.RemoveBoundary(user, ms.GlobalBoundary, subCA, out error), "Successfully removed a boundary from a grandparent isntead of failing!");
});
Expand Down
Loading