From 6497738c2d7bf597b92fac2793a061a13e1b102d Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Thu, 23 Mar 2023 07:08:30 +0300 Subject: Add Test template --- RhSolutions.Tests/CalculationTests.cs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 RhSolutions.Tests/CalculationTests.cs (limited to 'RhSolutions.Tests/CalculationTests.cs') diff --git a/RhSolutions.Tests/CalculationTests.cs b/RhSolutions.Tests/CalculationTests.cs new file mode 100644 index 0000000..d6c54c2 --- /dev/null +++ b/RhSolutions.Tests/CalculationTests.cs @@ -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); + } +} \ No newline at end of file -- cgit v1.2.3