Skip to content

Commit c91f5f3

Browse files
committed
Force to version 3.1.300 of .NETSDK
1 parent 97f1f3a commit c91f5f3

File tree

5 files changed

+86
-31
lines changed

5 files changed

+86
-31
lines changed

src/NotebookUnit/NotebookUnit.csproj

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<OutputType>Library</OutputType>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
<IncludeBuildOutput>true</IncludeBuildOutput>
7+
<IsPackable>true</IsPackable>
8+
<PackageDescription>A unit test library for .NET Interactive in Jupyter Notebooks</PackageDescription>
59
</PropertyGroup>
610

711
<ItemGroup>
812
<PackageReference Include="microsoft.dotnet.interactive" Version="1.0.0-beta.20418.1" />
913
<PackageReference Include="microsoft.dotnet.interactive.csharp" Version="1.0.0-beta.20418.1" />
1014
</ItemGroup>
1115

16+
<ItemGroup>
17+
<Compile Remove="bin\**" />
18+
<EmbeddedResource Remove="bin\**" />
19+
<None Remove="bin\**" />
20+
</ItemGroup>
21+
22+
<ItemGroup>
23+
<None Include="$(OutputPath)/NotebookUnit.dll" Pack="true" PackagePath="interactive-extensions/dotnet" />
24+
</ItemGroup>
25+
1226
</Project>

src/NotebookUnit/NotebookUnit.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30420.98
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NotebookUnit", "NotebookUnit.csproj", "{F4AED3EE-694A-4D83-A8C1-165BB5568128}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{F4AED3EE-694A-4D83-A8C1-165BB5568128}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{F4AED3EE-694A-4D83-A8C1-165BB5568128}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{F4AED3EE-694A-4D83-A8C1-165BB5568128}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{F4AED3EE-694A-4D83-A8C1-165BB5568128}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {AD15729A-AEDD-4880-A658-F53E70F854DE}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using System;
2+
using System.CommandLine;
3+
using System.CommandLine.Invocation;
4+
using System.Threading.Tasks;
5+
using Microsoft.DotNet.Interactive;
6+
using Microsoft.DotNet.Interactive.Events;
7+
8+
namespace NotebookUnit
9+
{
10+
public class RunTestsMagicCommand : IKernelExtension
11+
{
12+
public async Task OnLoadAsync(Kernel kernel)
13+
{
14+
15+
var testCommand = new Command("#!test", "Run the tests in this notebook")
16+
{
17+
new Option<string>("-s", "Dunno why I'm adding this, I just want it to run")
18+
};
19+
20+
testCommand.Handler = CommandHandler.Create(async (KernelInvocationContext context) =>
21+
{
22+
context.Publish(
23+
new DisplayedValueProduced
24+
("This is a test",
25+
context.Command,
26+
new[] { new FormattedValue("text/plain", "This is my formatted value") }
27+
)
28+
);
29+
});
30+
31+
kernel.AddDirective(testCommand);
32+
33+
// This doesn't appear to be working
34+
//if (KernelInvocationContext.Current is { } context)
35+
//{
36+
// await context.DisplayAsync($"`{nameof(RunTestsMagicCommand)}` is loaded. It adds unit test capabilities");
37+
//}
38+
39+
}
40+
}
41+
}

src/NotebookUnit/TestKernelExtension.cs

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "3.1.300"
4+
}
5+
}

0 commit comments

Comments
 (0)