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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -43,3 +43,4 @@ public static IGeometry GetGeometry3DViaExtensionMethod(this ConcreteSection sec
}
}
}

2 changes: 1 addition & 1 deletion .ci/unit-tests/Example_Engine/Example_Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<Description>https://github.com/BHoM/Test_Toolkit</Description>
<Configurations>Debug;Release;Test</Configurations>
<FileVersion>8.0.0.0</FileVersion>
<FileVersion>8.1.0.0</FileVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -48,3 +48,4 @@ public static IGeometry GetGeometryViaExtensionMethodToCall(this ConcreteSection
}
}
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -50,3 +50,4 @@ public void CorrectlyReferencedAssembliesTests()
}
}


3 changes: 2 additions & 1 deletion .ci/unit-tests/NUnit_Engine_Tests/Example_Engine_Tests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -52,3 +52,4 @@ public void DynamicallyLoadedDependency()
}
}


Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
Expand All @@ -5,7 +5,7 @@
<Description>https://github.com/BHoM/Test_Toolkit</Description>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<FileVersion>8.0.0.0</FileVersion>
<FileVersion>8.1.0.0</FileVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;Test</Configurations>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -71,3 +71,4 @@ public void LoadAssembliesShouldThrowException()

}


Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -88,3 +88,4 @@ public void DynamicallyRequiredAssemblyFailsLoading()
}
}


Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
Expand All @@ -5,7 +5,7 @@
<Description>https://github.com/BHoM/Test_Toolkit</Description>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<FileVersion>8.0.0.0</FileVersion>
<FileVersion>8.1.0.0</FileVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<IsPackable>false</IsPackable>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -35,3 +35,4 @@ public class SampleTestClass : NUnitTest { }
}



Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>

Check warning on line 1 in CodeComplianceTest_Engine/CodeComplianceTest_Engine.csproj

View check run for this annotation

BHoMBot-CI / project-compliance

CodeComplianceTest_Engine/CodeComplianceTest_Engine.csproj#L1

CSProject files should be in the new format as used by core BHoM projects. Upgrading the file is possible for .Net Framework 4.7.2 projects as well. Please speak to a member of the DevOps team for assistance with this.
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.CodeAnalysis.Analyzers.2.9.4\build\Microsoft.CodeAnalysis.Analyzers.props" Condition="Exists('..\packages\Microsoft.CodeAnalysis.Analyzers.2.9.4\build\Microsoft.CodeAnalysis.Analyzers.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
Expand Down Expand Up @@ -156,7 +156,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Query\Checks\AttributeHasEndingPunctuation.cs" />
<Compile Include="Query\Checks\HasConstructor.cs" />
<Compile Include="Query\Checks\HasOneConstructor.cs" />
<Compile Include="Query\Checks\HasUniqueMultiOutputAttributes.cs" />
<Compile Include="Query\Checks\HasValidConstructor.cs" />
<Compile Include="Query\Checks\HasValidCopyright.cs" />
Expand All @@ -171,7 +170,6 @@
<Compile Include="Query\Checks\EngineClassMatchesFilePath.cs" />
<Compile Include="Query\Checks\HasValidOutputAttribute.cs" />
<Compile Include="Query\Checks\IsInputAttributePresent.cs" />
<Compile Include="Query\Checks\HasSingleClass.cs" />
<Compile Include="Query\Checks\InputAttributeIsUnique.cs" />
<Compile Include="Query\Checks\InputParameterStartsLower.cs" />
<Compile Include="Query\Checks\IsValidIImmutableObject.cs" />
Expand Down Expand Up @@ -270,7 +268,7 @@
<Error Condition="!Exists('..\packages\Microsoft.CodeAnalysis.Analyzers.2.9.4\build\Microsoft.CodeAnalysis.Analyzers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeAnalysis.Analyzers.2.9.4\build\Microsoft.CodeAnalysis.Analyzers.props'))" />
</Target>
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y

Check warning on line 271 in CodeComplianceTest_Engine/CodeComplianceTest_Engine.csproj

View check run for this annotation

BHoMBot-CI / project-compliance

CodeComplianceTest_Engine/CodeComplianceTest_Engine.csproj#L271

Post Build event should be correctly set to copy the compiled DLL to the BHoM Assemblies folder
xcopy "$(TargetDir)Microsoft.CodeAnalysis.dll" "C:\ProgramData\BHoM\Assemblies" /Y
xcopy "$(TargetDir)Microsoft.CodeAnalysis.CSharp.dll" "C:\ProgramData\BHoM\Assemblies" /Y
xcopy "$(TargetDir)System.Buffers.dll" "C:\ProgramData\BHoM\Assemblies" /Y
Expand All @@ -289,4 +287,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Compute/Check.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -97,3 +97,4 @@ public static TestResult Check(this MethodInfo method, IEnumerable<SyntaxNode> n




3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Compute/CheckAssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*

Check failure on line 1 in CodeComplianceTest_Engine/Compute/CheckAssemblyInfo.cs

View check run for this annotation

BHoMBot-CI / project-compliance

CodeComplianceTest_Engine/Compute/CheckAssemblyInfo.cs#L1

Assembly Version should be set to 8.0.0.0

Check failure on line 1 in CodeComplianceTest_Engine/Compute/CheckAssemblyInfo.cs

View check run for this annotation

BHoMBot-CI / project-compliance

CodeComplianceTest_Engine/Compute/CheckAssemblyInfo.cs#L1

Assembly File Version should be set to 8.1.0.0

Check failure on line 1 in CodeComplianceTest_Engine/Compute/CheckAssemblyInfo.cs

View check run for this annotation

BHoMBot-CI / project-compliance

CodeComplianceTest_Engine/Compute/CheckAssemblyInfo.cs#L1

Assembly Description should contain the URL to the GitHub organisation which owns the repository
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -129,3 +129,4 @@




9 changes: 5 additions & 4 deletions CodeComplianceTest_Engine/Compute/CheckProjectFile.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -99,7 +99,7 @@ private static List<string> ReadFileContents(string fileName)

private static TestResult CheckNETTarget(this ProjectFile csProject, List<string> fileLines, TestResult finalResult, string csProjFilePath, string documentationLink)
{
List<string> acceptableNETTargets = new List<string> { "v4.7.2", "net472", "net48", "net480", "net481", "netstandard2.0", "net5.0", "net6.0" };
List<string> acceptableNETTargets = new List<string> { "v4.7.2", "net472", "net48", "net480", "net481", "netstandard2.0", "net5.0", "net6.0", "net7.0", "net8.0", "net9.0" };
bool atLeastOneCorrect = false;

foreach(string target in csProject.TargetNETVersions)
Expand All @@ -108,15 +108,15 @@ private static TestResult CheckNETTarget(this ProjectFile csProject, List<string
{
string fullXMLText = $"<TargetFramework>{target}</TargetFramework>";
int lineNumber = fileLines.IndexOf(fileLines.Where(x => x.Contains(fullXMLText)).FirstOrDefault()) + 1; //+1 because index is 0 based but line numbers start at 1 for the spans
finalResult = finalResult.Merge(Create.TestResult(TestStatus.Warning, new List<Error> { Create.Error($"Target frameworks for BHoM projects should either be .Net Framework 4.7.2, .Net Framework 4.8, .Net Framework 4.8.1, .Net Standard 2.0, .Net 5.0, or .Net 6.0.", Create.Location(csProjFilePath, Create.LineSpan(lineNumber, lineNumber)), documentationLink, TestStatus.Warning) }));
finalResult = finalResult.Merge(Create.TestResult(TestStatus.Warning, new List<Error> { Create.Error($"Target frameworks for BHoM projects should either be .Net Framework 4.7.2, .Net Framework 4.8, .Net Framework 4.8.1, .Net Standard 2.0 or, .Net 5.0 to 9.0.", Create.Location(csProjFilePath, Create.LineSpan(lineNumber, lineNumber)), documentationLink, TestStatus.Warning) }));
}
else
atLeastOneCorrect = true;
}

if(!atLeastOneCorrect)
{
finalResult = finalResult.Merge(Create.TestResult(TestStatus.Error, new List<Error> { Create.Error($"At least one of the Target frameworks for BHoM projects must either be .Net Framework 4.7.2, .Net Standard 2.0, or .Net 5.0.", Create.Location(csProjFilePath, Create.LineSpan(1, 1)), documentationLink) }));
finalResult = finalResult.Merge(Create.TestResult(TestStatus.Error, new List<Error> { Create.Error($"At least one of the Target frameworks for BHoM projects must either be .Net Framework 4.7.2, .Net Framework 4.8, .Net Framework 4.8.1, .Net Standard 2.0, or .Net 5.0 to 9.0.", Create.Location(csProjFilePath, Create.LineSpan(1, 1)), documentationLink) }));
}

return finalResult;
Expand Down Expand Up @@ -363,3 +363,4 @@ private static ProjectFile GetProjectFile(List<string> fileLines)




Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -125,3 +125,4 @@ public static TestResult CheckProjectStructure(this string projectDirectory)




3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Compute/RunChecks.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -81,3 +81,4 @@ public static TestResult RunChecks(this string filePath, string checkType)




3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Convert/ToLineLocation.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -53,3 +53,4 @@ public static LineLocation ToLineLocation(this int position, string context)




3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Convert/ToLineSpan.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -45,3 +45,4 @@ public static LineSpan ToLineSpan(this Span span, string context)




3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Convert/ToPosition.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -53,3 +53,4 @@ public static int ToPosition(this LineLocation location, string context)




3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Convert/ToSpan.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -55,3 +55,4 @@ public static Span ToSpan(this Microsoft.CodeAnalysis.Text.TextSpan span)




3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Convert/ToSyntaxTree.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -46,3 +46,4 @@ public static SyntaxTree ToSyntaxTree(this string code, string path = "")




3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Convert/ToText.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -53,3 +53,4 @@ public static string ToText(this Error error)




3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Create/Error.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -51,3 +51,4 @@ public static Error Error(string message, Location location, string documentatio




3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Create/LineLocation.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -46,3 +46,4 @@ public static LineLocation LineLocation(int line, int column)




3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Create/LineSpan.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -47,3 +47,4 @@ public static LineSpan LineSpan(int firstLine, int lastLine)




3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Create/Location.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -47,3 +47,4 @@ public static Location Location(string filePath = "", LineSpan line = null)




3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Create/Span.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -42,3 +42,4 @@ public static Span Span(this int start, int length)




3 changes: 2 additions & 1 deletion CodeComplianceTest_Engine/Create/TestResult.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2024, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -52,3 +52,4 @@ public static TestResult TestResult(TestStatus status, List<Error> errors = null




Loading