Skip to content
Open
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
5 changes: 3 additions & 2 deletions xUnitRevitRunner/xUnitRevitRunnerShared/Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ internal static void Launch(UIApplication uiapp)
var queue = new List<Action>();
var eventHandler = ExternalEvent.Create(new ExternalEventHandler(queue));

xru.Initialize(uiapp, SynchronizationContext.Current, eventHandler, queue);

var main = new MainWindow
{
Title = "xUnit Revit Runner by Speckle",
Expand All @@ -35,7 +33,10 @@ internal static void Launch(UIApplication uiapp)

//pre-load asssemblies, if you're a lazy developer
if (main.DataContext is MainViewModel mainViewModel)
{
xru.Initialize(uiapp, SynchronizationContext.Current, eventHandler, queue, mainViewModel);
mainViewModel.StartupAssemblies = Config.StartupAssemblies.ToList();
}
main.Show();
}
catch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

<ItemGroup>
<PackageReference Include="ModPlus.Revit.API.2019" Version="4.0.0" />
<PackageReference Include="xunit" Version="2.4.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\speckle.xunit.runner.wpf\speckle.xunit.runner.wpf\speckle.xunit.runner.wpf.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

<ItemGroup>
<PackageReference Include="ModPlus.Revit.API.2020" Version="4.0.0" />
<PackageReference Include="xunit" Version="2.4.2" />
</ItemGroup>


<ItemGroup>
<ProjectReference Include="..\..\speckle.xunit.runner.wpf\speckle.xunit.runner.wpf\speckle.xunit.runner.wpf.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@
<PackageReference Include="xunit" Version="2.4.2" />
</ItemGroup>


<ItemGroup>
<ProjectReference Include="..\..\speckle.xunit.runner.wpf\speckle.xunit.runner.wpf\speckle.xunit.runner.wpf.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@


<ItemGroup>
<PackageReference Include="Speckle.Revit.API" Version="2022.0.2.1" >
<PackageReference Include="Speckle.Revit.API" Version="2022.0.2.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.2" />
</ItemGroup>


<ItemGroup>
<ProjectReference Include="..\..\speckle.xunit.runner.wpf\speckle.xunit.runner.wpf\speckle.xunit.runner.wpf.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@
<PackageReference Include="xunit" Version="2.4.2" />
</ItemGroup>


<ItemGroup>
<ProjectReference Include="..\..\speckle.xunit.runner.wpf\speckle.xunit.runner.wpf\speckle.xunit.runner.wpf.csproj" />
</ItemGroup>

</Project>
10 changes: 10 additions & 0 deletions xUnitRevitUtils/xUnitRevitUtilsShared/xru.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Xunit;
using Xunit.Runner.Wpf.ViewModel;

namespace xUnitRevitUtils
{
Expand All @@ -13,13 +14,22 @@ public static class xru
private static IList<Action> Queue { get; set; }
private static ExternalEvent EventHandler { get; set; }
public static SynchronizationContext UiContext { get; set; }
public static MainViewModel MainViewModel { get; set; }
public static void Initialize(UIApplication uiapp, SynchronizationContext uiContext, ExternalEvent eventHandler, IList<Action> queue)
{
Uiapp = uiapp;
UiContext = uiContext;
EventHandler = eventHandler;
Queue = queue;
}
public static void Initialize(UIApplication uiapp, SynchronizationContext uiContext, ExternalEvent eventHandler, IList<Action> queue, MainViewModel vm)
{
Uiapp = uiapp;
UiContext = uiContext;
EventHandler = eventHandler;
Queue = queue;
MainViewModel = vm;
}

#region utility methods

Expand Down