Skip to content

Commit bee52ae

Browse files
author
sagi
committed
Update TestingSample to SDK-style
1 parent aa611b6 commit bee52ae

11 files changed

+47
-363
lines changed

Testing/TestingSample/Sample.Test/ExcelTests.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Xunit;
33
using ExcelDna.Testing;
44
using Microsoft.Office.Interop.Excel;
5+
using ExcelDna.Integration;
56

67
// This attribute MUST be present somewhere in the test project to connect xUnit to the ExcelDna.Testing framework.
78
// It could also be placed in the Properties\AssemblyInfo.cs file.
@@ -36,7 +37,7 @@ public void Dispose()
3637
[ExcelFact]
3738
public void ExcelCanAddNumbers()
3839
{
39-
var ws = _testWorkbook.Sheets[1];
40+
Worksheet ws = (Worksheet) _testWorkbook.Sheets[1];
4041

4142
ws.Range["A1"].Value = 2.0;
4243
ws.Range["A2"].Value = 3.0;
@@ -52,7 +53,7 @@ public void ExcelCanAddNumbers()
5253
[ExcelFact]
5354
public void AddInCanAddNumbers()
5455
{
55-
var ws = _testWorkbook.Sheets[1];
56+
Worksheet ws = (Worksheet) _testWorkbook.Sheets[1];
5657

5758
ws.Range["A1"].Value = 2.0;
5859
ws.Range["A2"].Value = 3.0;
@@ -70,7 +71,7 @@ public void WorkbookCheckIsOK()
7071
{
7172
// Get the pre-loaded workbook using the Util.Workbook property
7273
var wb = Util.Workbook;
73-
var ws = wb.Sheets["Check"];
74+
Worksheet ws = (Worksheet) wb.Sheets["Check"];
7475
Util.Application.CalculateFull();
7576

7677
var result = ws.Range["A1"].Value;

Testing/TestingSample/Sample.Test/Properties/AssemblyInfo.cs

-36
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"profiles": {
3+
"Excel": {
4+
"commandName": "Executable",
5+
"executablePath": "C:\\Program Files\\Microsoft Office\\root\\Office16\\EXCEL.EXE",
6+
"commandLineArgs": "Sample.Test-AddIn64.xll"
7+
}
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,16 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\xunit.runner.visualstudio.2.4.3\build\net452\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.4.3\build\net452\xunit.runner.visualstudio.props')" />
4-
<Import Project="..\packages\xunit.core.2.4.1\build\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.4.1\build\xunit.core.props')" />
5-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
6-
<PropertyGroup>
7-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9-
<ProjectGuid>{BF559676-9F49-4508-AAC7-AA824053ADF7}</ProjectGuid>
10-
<OutputType>Library</OutputType>
11-
<AppDesignerFolder>Properties</AppDesignerFolder>
12-
<RootNamespace>Sample.Test</RootNamespace>
13-
<AssemblyName>Sample.Test</AssemblyName>
14-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
15-
<FileAlignment>512</FileAlignment>
16-
<Deterministic>true</Deterministic>
17-
<NuGetPackageImportStamp>
18-
</NuGetPackageImportStamp>
19-
</PropertyGroup>
20-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
21-
<DebugSymbols>true</DebugSymbols>
22-
<DebugType>full</DebugType>
23-
<Optimize>false</Optimize>
24-
<OutputPath>bin\Debug\</OutputPath>
25-
<DefineConstants>DEBUG;TRACE</DefineConstants>
26-
<ErrorReport>prompt</ErrorReport>
27-
<WarningLevel>4</WarningLevel>
28-
</PropertyGroup>
29-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
30-
<DebugType>pdbonly</DebugType>
31-
<Optimize>true</Optimize>
32-
<OutputPath>bin\Release\</OutputPath>
33-
<DefineConstants>TRACE</DefineConstants>
34-
<ErrorReport>prompt</ErrorReport>
35-
<WarningLevel>4</WarningLevel>
36-
</PropertyGroup>
37-
<ItemGroup>
38-
<Reference Include="ExcelDna.Integration, Version=1.1.0.0, Culture=neutral, PublicKeyToken=f225e9659857edbe, processorArchitecture=MSIL">
39-
<HintPath>..\packages\ExcelDna.Integration.1.1.0\lib\ExcelDna.Integration.dll</HintPath>
40-
</Reference>
41-
<Reference Include="ExcelDna.Testing, Version=0.1.0.0, Culture=neutral, processorArchitecture=MSIL">
42-
<HintPath>..\packages\ExcelDna.Testing.0.1.0-preview\lib\ExcelDna.Testing.dll</HintPath>
43-
</Reference>
44-
<Reference Include="Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
45-
<HintPath>..\packages\ExcelDna.Interop.14.0.1\lib\Microsoft.Office.Interop.Excel.dll</HintPath>
46-
<EmbedInteropTypes>True</EmbedInteropTypes>
47-
</Reference>
48-
<Reference Include="Microsoft.Vbe.Interop, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
49-
<HintPath>..\packages\ExcelDna.Interop.14.0.1\lib\Microsoft.Vbe.Interop.dll</HintPath>
50-
<EmbedInteropTypes>True</EmbedInteropTypes>
51-
</Reference>
52-
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
53-
<HintPath>..\packages\Microsoft.VisualStudio.OLE.Interop.16.7.30328.74\lib\net45\Microsoft.VisualStudio.OLE.Interop.dll</HintPath>
54-
</Reference>
55-
<Reference Include="Office, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
56-
<HintPath>..\packages\ExcelDna.Interop.14.0.1\lib\Office.dll</HintPath>
57-
<EmbedInteropTypes>True</EmbedInteropTypes>
58-
</Reference>
59-
<Reference Include="System" />
60-
<Reference Include="System.Core" />
61-
<Reference Include="System.Xml.Linq" />
62-
<Reference Include="System.Data.DataSetExtensions" />
63-
<Reference Include="Microsoft.CSharp" />
64-
<Reference Include="System.Data" />
65-
<Reference Include="System.Net.Http" />
66-
<Reference Include="System.Xml" />
67-
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
68-
<HintPath>..\packages\xunit.abstractions.2.0.3\lib\net35\xunit.abstractions.dll</HintPath>
69-
</Reference>
70-
<Reference Include="xunit.assert, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
71-
<HintPath>..\packages\xunit.assert.2.4.1\lib\netstandard1.1\xunit.assert.dll</HintPath>
72-
</Reference>
73-
<Reference Include="xunit.core, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
74-
<HintPath>..\packages\xunit.extensibility.core.2.4.1\lib\net452\xunit.core.dll</HintPath>
75-
</Reference>
76-
<Reference Include="xunit.execution.desktop, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
77-
<HintPath>..\packages\xunit.extensibility.execution.2.4.1\lib\net452\xunit.execution.desktop.dll</HintPath>
78-
</Reference>
79-
</ItemGroup>
80-
<ItemGroup>
81-
<Compile Include="ExcelTests.cs" />
82-
<Compile Include="Properties\AssemblyInfo.cs" />
83-
</ItemGroup>
84-
<ItemGroup>
85-
<None Include="packages.config" />
86-
<None Include="TestBook.xlsx">
87-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
88-
</None>
89-
</ItemGroup>
90-
<ItemGroup>
91-
<Analyzer Include="..\packages\xunit.analyzers.0.10.0\analyzers\dotnet\cs\xunit.analyzers.dll" />
92-
</ItemGroup>
93-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
94-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
95-
<PropertyGroup>
96-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
97-
</PropertyGroup>
98-
<Error Condition="!Exists('..\packages\xunit.core.2.4.1\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.4.1\build\xunit.core.props'))" />
99-
<Error Condition="!Exists('..\packages\xunit.core.2.4.1\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.4.1\build\xunit.core.targets'))" />
100-
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.4.3\build\net452\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.4.3\build\net452\xunit.runner.visualstudio.props'))" />
101-
<Error Condition="!Exists('..\packages\ExcelDna.Testing.0.1.0-preview\build\ExcelDna.Testing.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ExcelDna.Testing.0.1.0-preview\build\ExcelDna.Testing.targets'))" />
102-
</Target>
103-
<Import Project="..\packages\xunit.core.2.4.1\build\xunit.core.targets" Condition="Exists('..\packages\xunit.core.2.4.1\build\xunit.core.targets')" />
104-
<Import Project="..\packages\ExcelDna.Testing.0.1.0-preview\build\ExcelDna.Testing.targets" Condition="Exists('..\packages\ExcelDna.Testing.0.1.0-preview\build\ExcelDna.Testing.targets')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net472</TargetFrameworks>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="ExcelDna.Addin" Version="1.6.0" />
9+
<PackageReference Include="ExcelDna.Testing" Version="1.6.0" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<Folder Include="Properties\" />
14+
</ItemGroup>
15+
10516
</Project>

Testing/TestingSample/Sample.Test/packages.config

-15
This file was deleted.

Testing/TestingSample/Sample/Properties/AssemblyInfo.cs

-36
This file was deleted.

Testing/TestingSample/Sample/Properties/ExcelDna.Build.props

-77
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"profiles": {
3+
"Excel": {
4+
"commandName": "Executable",
5+
"executablePath": "C:\\Program Files\\Microsoft Office\\root\\Office16\\EXCEL.EXE",
6+
"commandLineArgs": "/x \"Sample-AddIn64.xll\""
7+
}
8+
}
9+
}

Testing/TestingSample/Sample/Sample-AddIn.dna

-23
This file was deleted.

0 commit comments

Comments
 (0)