Skip to content

Commit 7b28475

Browse files
committed
Added support for running .NET Core tests.
1 parent dbb954d commit 7b28475

File tree

61 files changed

+396
-1189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+396
-1189
lines changed

Source/Machine.VSTestAdapter.Specs/Discovery/BuiltIn/When_discovering_behaviors.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ public class When_discovering_specs_using_behaviors : With_DiscoverySetup<BuiltI
1616
"BehaviorSampleSpec".Equals(x.ClassName, StringComparison.Ordinal));
1717
discoveredSpec.ShouldNotBeNull();
1818

19+
#if !NETSTANDARD
1920
discoveredSpec.LineNumber.ShouldEqual(14);
2021
discoveredSpec.CodeFilePath.EndsWith("BehaviorSample.cs", StringComparison.Ordinal);
22+
#endif
2123
};
2224
}
2325
}

Source/Machine.VSTestAdapter.Specs/Discovery/BuiltIn/When_discovering_specs.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,32 @@ public class When_discovering_specs : With_DiscoverySetup<BuiltInSpecificationDi
1414
"StandardSpec".Equals(x.ClassName, StringComparison.Ordinal));
1515
discoveredSpec.ShouldNotBeNull();
1616

17+
#if !NETSTANDARD
1718
discoveredSpec.LineNumber.ShouldEqual(14);
1819
discoveredSpec.CodeFilePath.EndsWith("StandardSpec.cs", StringComparison.Ordinal);
20+
#endif
1921
};
2022

2123
It should_find_empty_spec = () => {
2224
MSpecTestCase discoveredSpec = Results.SingleOrDefault(x => "should_be_ignored".Equals(x.SpecificationName, StringComparison.Ordinal) &&
2325
"StandardSpec".Equals(x.ClassName, StringComparison.Ordinal));
2426
discoveredSpec.ShouldNotBeNull();
2527

28+
#if !NETSTANDARD
2629
discoveredSpec.LineNumber.ShouldEqual(20);
2730
discoveredSpec.CodeFilePath.EndsWith("StandardSpec.cs", StringComparison.Ordinal);
31+
#endif
2832
};
2933

3034
It should_find_ignored_spec_but_will_not_find_line_number = () => {
3135
MSpecTestCase discoveredSpec = Results.SingleOrDefault(x => "not_implemented".Equals(x.SpecificationName, StringComparison.Ordinal) &&
3236
"StandardSpec".Equals(x.ClassName, StringComparison.Ordinal));
3337
discoveredSpec.ShouldNotBeNull();
3438

39+
#if !NETSTANDARD
3540
discoveredSpec.LineNumber.ShouldEqual(0);
3641
discoveredSpec.CodeFilePath.ShouldBeNull();
42+
#endif
3743
};
3844
}
3945
}

Source/Machine.VSTestAdapter.Specs/Discovery/BuiltIn/When_discovering_specs_in_nested_types.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ public class When_discovering_specs_in_nested_types : With_DiscoverySetup<BuiltI
1616

1717
discoveredSpec.ContextDisplayName.ShouldEqual("Parent NestedSpec");
1818

19+
#if !NETSTANDARD
1920
discoveredSpec.LineNumber.ShouldEqual(14);
2021
discoveredSpec.CodeFilePath.EndsWith("NestedSpecSample.cs", StringComparison.Ordinal);
22+
#endif
2123
};
2224
}
2325
}

Source/Machine.VSTestAdapter.Specs/Discovery/BuiltIn/When_discovering_specs_with_custom_act_assert_delegates.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ public class When_discovering_specs_with_custom_act_assert_delegates : With_Disc
1414
"CustomActAssertDelegateSpec".Equals(x.ClassName, StringComparison.Ordinal));
1515
discoveredSpec.ShouldNotBeNull();
1616

17+
#if !NETSTANDARD
1718
discoveredSpec.LineNumber.ShouldEqual(31);
1819
discoveredSpec.CodeFilePath.EndsWith("CustomActAssertDelegateSpec.cs", StringComparison.Ordinal);
20+
#endif
1921
};
2022
}
2123
}

Source/Machine.VSTestAdapter.Specs/Discovery/Cecil/When_discovering_behaviors.cs

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

Source/Machine.VSTestAdapter.Specs/Discovery/Cecil/When_discovering_specs.cs

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

Source/Machine.VSTestAdapter.Specs/Discovery/Cecil/When_discovering_specs_in_nested_types.cs

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

Source/Machine.VSTestAdapter.Specs/Discovery/Cecil/When_discovering_specs_with_custom_act_assert_delegates.cs

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

Source/Machine.VSTestAdapter.Specs/Discovery/When_DisableFullTestNameInIDE_is_off.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
using System;
2-
using System.Linq;
32
using Machine.Fakes;
43
using Machine.Specifications;
5-
using Machine.VSTestAdapter.Configuration;
6-
using Machine.VSTestAdapter.Discovery;
7-
using Machine.VSTestAdapter.Execution;
84
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
95
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter;
106
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
117
using SampleSpecs;
8+
using System.Reflection;
129

1310
namespace Machine.VSTestAdapter.Specs.Discovery
1411
{
1512
public class When_DisableFullTestNameInIDE_is_off : WithFakes
1613
{
1714

1815
Because of = () => {
19-
The<MSpecTestAdapter>().DiscoverTests(new[] { typeof(When_something).Assembly.Location },
16+
The<MSpecTestAdapter>().DiscoverTests(new[] { typeof(When_something).GetTypeInfo().Assembly.Location },
2017
An<IDiscoveryContext>(),
2118
An<IMessageLogger>(),
2219
The<ITestCaseDiscoverySink>());

Source/Machine.VSTestAdapter.Specs/Discovery/When_DisableFullTestNameInIDE_is_on.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter;
88
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
99
using SampleSpecs;
10+
using System.Reflection;
1011

1112
namespace Machine.VSTestAdapter.Specs.Discovery
1213
{
@@ -28,7 +29,7 @@ public class When_DisableFullTestNameInIDE_is_on : WithFakes
2829

2930

3031
Because of = () => {
31-
The<MSpecTestAdapter>().DiscoverTests(new[] { typeof(StandardSpec).Assembly.Location },
32+
The<MSpecTestAdapter>().DiscoverTests(new[] { typeof(StandardSpec).GetTypeInfo().Assembly.Location },
3233
The<IDiscoveryContext>(),
3334
An<IMessageLogger>(),
3435
The<ITestCaseDiscoverySink>());

0 commit comments

Comments
 (0)