Compare commits
No commits in common. "2cb7cd0377ffca9aba1cc7912963b691bbe2e519" and "2cef4d1d9f95ee358b61963dff1ce71e97e9a03c" have entirely different histories.
2cb7cd0377
...
2cef4d1d9f
@ -1,25 +1,24 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net472;net6.0-windows</TargetFrameworks>
|
<TargetFrameworks>net472;net6.0-windows</TargetFrameworks>
|
||||||
<LangVersion>10</LangVersion>
|
<OutputType>Library</OutputType>
|
||||||
<OutputType>Library</OutputType>
|
<RootNamespace>RhSolutions.AddIn</RootNamespace>
|
||||||
<RootNamespace>RhSolutions.AddIn</RootNamespace>
|
<AssemblyName>RhSolutions.AddIn</AssemblyName>
|
||||||
<AssemblyName>RhSolutions.AddIn</AssemblyName>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
||||||
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
</PropertyGroup>
|
||||||
</PropertyGroup>
|
<PropertyGroup>
|
||||||
<PropertyGroup>
|
<StartupObject />
|
||||||
<StartupObject />
|
</PropertyGroup>
|
||||||
</PropertyGroup>
|
<ItemGroup>
|
||||||
<ItemGroup>
|
<PackageReference Include="ExcelDna.AddIn" Version="1.6.0" />
|
||||||
<PackageReference Include="ExcelDna.AddIn" Version="1.6.0" />
|
<PackageReference Include="ExcelDna.Integration" Version="1.6.0" />
|
||||||
<PackageReference Include="ExcelDna.Integration" Version="1.6.0" />
|
<PackageReference Include="ExcelDna.IntelliSense" Version="1.6.0" />
|
||||||
<PackageReference Include="ExcelDna.IntelliSense" Version="1.6.0" />
|
<PackageReference Include="ExcelDna.Interop" Version="15.0.1" />
|
||||||
<PackageReference Include="ExcelDna.Interop" Version="15.0.1" />
|
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="RhSolutions.Sku" Version="0.1.1" />
|
||||||
<PackageReference Include="RhSolutions.Sku" Version="0.1.1" />
|
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
</ItemGroup>
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
</Project>
|
30
RhSolutions.Tests/CalculationTests.cs
Normal file
30
RhSolutions.Tests/CalculationTests.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
namespace RhSolutions.Tests;
|
||||||
|
|
||||||
|
public class CalculationTests : IDisposable
|
||||||
|
{
|
||||||
|
private Workbook workbook;
|
||||||
|
|
||||||
|
public CalculationTests()
|
||||||
|
{
|
||||||
|
workbook = Util.Application.Workbooks.Add();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
workbook.Close(SaveChanges: false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[ExcelFact]
|
||||||
|
public void NumbersAddCorrectly()
|
||||||
|
{
|
||||||
|
var ws = workbook.Sheets[1];
|
||||||
|
|
||||||
|
ws.Range["A1"].Value = 2.0;
|
||||||
|
ws.Range["A2"].Value = 3.0;
|
||||||
|
ws.Range["A3"].Formula = "= A1 + A2";
|
||||||
|
|
||||||
|
var result = ws.Range["A3"].Value;
|
||||||
|
|
||||||
|
Assert.Equal(5.0, result);
|
||||||
|
}
|
||||||
|
}
|
@ -1,29 +1,14 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net472</TargetFramework>
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
<LangVersion>10</LangVersion>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<Nullable>enable</Nullable>
|
||||||
<Nullable>enable</Nullable>
|
<OutputType>Library</OutputType>
|
||||||
<OutputType>Library</OutputType>
|
</PropertyGroup>
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ExcelDna.Interop" Version="15.0.1" />
|
<PackageReference Include="ExcelDna.Testing" Version="1.6.0" />
|
||||||
<PackageReference Include="ExcelDna.Testing" Version="1.6.0" />
|
</ItemGroup>
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\RhSolutions.AddIn\RhSolutions.AddIn.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Update="TestWorkbooks\EmptyTestTable.xlsx">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Update="TestWorkbooks\EmptyWorkbook.xlsx">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,25 +1,26 @@
|
|||||||
namespace RhSolutions.Tests;
|
namespace RhSolutions.Tests;
|
||||||
|
|
||||||
[ExcelTestSettings(OutOfProcess = true)]
|
[ExcelTestSettings(AddIn = @"..\..\..\..\RhSolutions.AddIn\bin\Debug\net6.0-windows\RhSolutions-AddIn")]
|
||||||
public class WorkbookCheck : IDisposable
|
public class RhSolutionsCheckTest : IDisposable
|
||||||
{
|
{
|
||||||
public WorkbookCheck()
|
private Workbook workbook;
|
||||||
|
|
||||||
|
public RhSolutionsCheckTest()
|
||||||
{
|
{
|
||||||
Util.Application.Workbooks.Add();
|
workbook = Util.Application.Workbooks.Add();
|
||||||
}
|
}
|
||||||
|
|
||||||
[ExcelFact(Workbook = @"TestWorkbooks\EmptyTestTable.xlsx")]
|
[ExcelFact]
|
||||||
public void WorksheetIsCorrect()
|
public void RhSolutionsFunctionWorks()
|
||||||
{
|
{
|
||||||
Worksheet worksheet= Util.Workbook.Sheets[1];
|
var ws = workbook.Sheets[1];
|
||||||
Assert.True(worksheet.IsRehauSource());
|
|
||||||
}
|
|
||||||
|
|
||||||
[ExcelFact(Workbook = @"TestWorkbooks\EmptyWorkbook.xlsx")]
|
ws.Range["A1"].Formula = "=RHSOLUTIONS(\"гильза 16\")";
|
||||||
public void EmptyWorkbookIsNotCorrect()
|
Util.Application.CalculateFull();
|
||||||
{
|
|
||||||
Worksheet worksheet = Util.Workbook.Sheets[1];
|
var result = ws.Range["A1"].Value;
|
||||||
Assert.False(worksheet.IsRehauSource());
|
|
||||||
|
Assert.Equal("Загрузка...", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -1,5 +1,3 @@
|
|||||||
global using Xunit;
|
global using Xunit;
|
||||||
global using Microsoft.Office.Interop.Excel;
|
global using Microsoft.Office.Interop.Excel;
|
||||||
global using ExcelDna.Testing;
|
global using ExcelDna.Testing;
|
||||||
global using RhSolutions.Models;
|
|
||||||
global using RhSolutions.Services;
|
|
||||||
|
16
RhSolutions.Tests/WorkbookCheckTests.cs
Normal file
16
RhSolutions.Tests/WorkbookCheckTests.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
//namespace RhSolutions.Tests;
|
||||||
|
|
||||||
|
//[ExcelTestSettings(AddIn = @"..\..\..\..\RhSolutions.AddIn\bin\Debug\net6.0-windows\RhSolutions-AddIn")]
|
||||||
|
//public class WorkbookCheckTests : IDisposable
|
||||||
|
//{
|
||||||
|
// [ExcelFact(Workbook = @".\Workbooks\EmptyTestTable.xlsx")]
|
||||||
|
// public void WorksheetIsCorrect()
|
||||||
|
// {
|
||||||
|
// Assert.True(true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public void Dispose()
|
||||||
|
// {
|
||||||
|
// Util.Application.ActiveWorkbook.Close(SaveChanges: false);
|
||||||
|
// }
|
||||||
|
//}
|
Loading…
x
Reference in New Issue
Block a user