From 513e81a83c73f2cc8da1438c390301cd9f894141 Mon Sep 17 00:00:00 2001 From: Mike Cole Date: Sun, 2 Oct 2016 08:46:46 -0500 Subject: [PATCH] Added tests. --- .../EPPlus.Extensions.Tests.csproj | 61 +++++--- src/EPPlus.Extensions.Tests/ExtensionTests.cs | 138 ++++++++++++++++++ src/EPPlus.Extensions.Tests/Marvel.xlsx | Bin 0 -> 5364 bytes src/EPPlus.Extensions.Tests/States.xlsx | Bin 0 -> 4279 bytes src/EPPlus.Extensions.Tests/packages.config | 1 + src/EPPlus.Extensions.sln | 8 +- src/EPPlus.Extensions/EPPlusExtensions.cs | 2 +- 7 files changed, 189 insertions(+), 21 deletions(-) create mode 100644 src/EPPlus.Extensions.Tests/ExtensionTests.cs create mode 100644 src/EPPlus.Extensions.Tests/Marvel.xlsx create mode 100644 src/EPPlus.Extensions.Tests/States.xlsx diff --git a/src/EPPlus.Extensions.Tests/EPPlus.Extensions.Tests.csproj b/src/EPPlus.Extensions.Tests/EPPlus.Extensions.Tests.csproj index 3c5b751..da728db 100644 --- a/src/EPPlus.Extensions.Tests/EPPlus.Extensions.Tests.csproj +++ b/src/EPPlus.Extensions.Tests/EPPlus.Extensions.Tests.csproj @@ -1,10 +1,10 @@ - + Debug AnyCPU - 2ccc31a1-9647-43ec-8179-acc7ab005ff2 + {2CCC31A1-9647-43EC-8179-ACC7AB005FF2} Library Properties EPPlus.Extensions.Tests @@ -30,25 +30,49 @@ 4 - - - - - - - - - - - - - - + + ..\packages\EPPlus.3.1.3.3\lib\net35\EPPlus.dll + True + + + ..\packages\Fixie.1.0.2\lib\net45\Fixie.dll + True + + + ..\packages\Shouldly.2.8.2\lib\net451\Shouldly.dll + True + + + + + + + + + - + + + + PreserveNewest + + + + PreserveNewest + + + + + {03756be7-6cc0-4d3e-80cf-3f7db49bc77a} + EPPlus.Extensions + + + + + - - + \ No newline at end of file diff --git a/src/EPPlus.Extensions.Tests/ExtensionTests.cs b/src/EPPlus.Extensions.Tests/ExtensionTests.cs new file mode 100644 index 0000000..e47fd63 --- /dev/null +++ b/src/EPPlus.Extensions.Tests/ExtensionTests.cs @@ -0,0 +1,138 @@ +using System; +using System.IO; +using System.Reflection; +using OfficeOpenXml; +using Shouldly; + +namespace EPPlus.Extensions.Tests +{ + public class ExtensionTests + { + public void ToDataSetSimple_ShouldHandleHeaderRows_WhenSpecified() + { + var package = GetMarvelPackage(); + + var result = package.ToDataSet(true); + + result.Tables[0].Rows.Count.ShouldBe(10); + } + + public void ToDataSetSimple_ShouldHandleHeaderRows_WhenNotSpecified() + { + var package = GetMarvelPackage(); + + var result = package.ToDataSet(false); + + result.Tables[0].Rows.Count.ShouldBe(11); + } + + public void ToDataSet_ShouldThrowException_WhenHeaderRowIsLessThanZero() + { + var package = new ExcelPackage(); + + var exception = Should.Throw(() => package.ToDataSet(-1)); + exception.ParamName.ShouldBe("headerRow"); + } + + public void ToDataSet_ShouldReturnOneTable_WhenOneSheet() + { + var package = GetStatesPackage(); + + var result = package.ToDataSet(0); + + result.Tables.Count.ShouldBe(1); + } + + public void ToDataSet_ShouldReturnTwoTables_WhenTwoSheets() + { + var package = GetMarvelPackage(); + + var result = package.ToDataSet(0); + + result.Tables.Count.ShouldBe(2); + } + + public void ToDataSet_ShouldHandleHeaderRows_WhenSetToZero() + { + var package = GetStatesPackage(); + + var result = package.ToDataSet(0); + + result.Tables[0].Rows.Count.ShouldBe(50); + } + + public void ToDataSet_ShouldHandleHeaderRows_WhenSetToOne() + { + var package = GetStatesPackage(); + + var result = package.ToDataSet(1); + + result.Tables[0].Rows.Count.ShouldBe(49); + } + + public void ToDataSet_ShouldHandleHeaderRows_WhenSetToTen() + { + var package = GetStatesPackage(); + + var result = package.ToDataSet(10); + + result.Tables[0].Rows.Count.ShouldBe(40); + } + + public void ToDataSet_ShouldNameColumnsWithHeaderValues_WhenHeaderValuesExist() + { + var package = GetMarvelPackage(); + + var result = package.ToDataSet(1); + + result.Tables[0].Columns[0].ColumnName.ShouldBe("First Name"); + result.Tables[0].Columns[1].ColumnName.ShouldBe("Last Name"); + result.Tables[0].Columns[2].ColumnName.ShouldBe("Alter Ego"); + } + + public void ToDataSet_ShouldUseGenericColumnNames_WhenHeaderValuesDoNotExist() + { + var package = GetStatesPackage(); + + var result = package.ToDataSet(0); + + result.Tables[0].Columns[0].ColumnName.ShouldBe("Column 1"); + } + + public void ToDataSet_ShouldAddColumns_ForEachSourceColumn() + { + var package = GetMarvelPackage(); + + var result = package.ToDataSet(0); + + result.Tables[0].Columns.Count.ShouldBe(3); + } + + public void ToDataSet_ShouldAddRows_ForEachSourceRow() + { + var package = GetStatesPackage(); + + var result = package.ToDataSet(0); + + result.Tables[0].Rows.Count.ShouldBe(50); + result.Tables[0].Rows[0][0].ToString().ShouldBe("Alabama"); + result.Tables[0].Rows[49][0].ToString().ShouldBe("Wyoming"); + } + + private static ExcelPackage GetMarvelPackage() + { + var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Marvel.xlsx"); + var file = new FileInfo(path); + var package = new ExcelPackage(file); + return package; + } + + private static ExcelPackage GetStatesPackage() + { + var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"States.xlsx"); + var file = new FileInfo(path); + var package = new ExcelPackage(file); + return package; + } + } +} \ No newline at end of file diff --git a/src/EPPlus.Extensions.Tests/Marvel.xlsx b/src/EPPlus.Extensions.Tests/Marvel.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..4cdb7b7276bd80a263568e18587b75dd5ffb8142 GIT binary patch literal 5364 zcmd^Dby$?^wkM?2HZ4Amx3Hp zjNuM=&JnqL?|bh3_pW*7neTg^_g(X@_^tI@uZAi%4mAcoK0d~Rp!{8o3qp&2cDLa- zcQkQ>!YrNs^&rUSZfo;;L{7b3fE;&(%0AfYs2H0lATxJPF$IHEU^05L%}igI&(5_8HCSr0_1b5C9i*falib-@J3W+BKcY(?wvEG=OY4_)&;t2~d~Te7!^R-K$2< zj2PPJYo(UDZVc@^8i?7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- z9Bl|EIx+s*R4VieeFZz1vjxlYw z5J37l;D9ef)&IT2+szdM?#GEbQn2G&TL?LPu&VM@e2;mNJ4~qN-PGz5lh4yU(g9*u zu)E^eghny;9DvX~Ml!HkDlwlX6|`8WqN-z5Vgp;GX7S6U7u0RPDZ}^8z3_xou+eWY zJ5z884}|1rZMwA?>l4Ah?r$BEFQYX;_VT62$pd?JCayMiC&1XOTqW6%CmF|vk>k!A zQFreJX~$lMVeabmImrFb{ohuNAO}o?2j`8?iSK2t2-@NK=M@nXiyGtCP0hs{i?f@W z-{r6FZ8TK>Q!SL}|NRp!=d|&%mWz|x?`Hv_k%887c``Y_AGoaL;;eHv)%}uOwEe$p z`O_Kivciij`S)WLpn3D}3V#hum$h7^nZF;a74Nc^3&;A!uP-aSNN3L2=`ZO*PrB%1 z{Wq?9S;NInc}9DFNh#q^4gV%Vm$zOl?q{v^m&6hO+nRqh*2|kO*1NO%|4RU*=bQhc z8(h|Nv6!4y$6un1KGTI-d3obSK%CW@Um{HYr7B4YGM4BgN2DbC*h3+4Hj Al>h($ literal 0 HcmV?d00001 diff --git a/src/EPPlus.Extensions.Tests/States.xlsx b/src/EPPlus.Extensions.Tests/States.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..4ebc17cf2bf6da517fb03a7775a2ca7cf8c1ce2b GIT binary patch literal 4279 zcmai1c|4R|8=f&56ULrIA-fVYjIHeZOPG+XS;vww7(^nKWkSkUmKcpfS+lPR^OB{q zly#6IqR5uX{>{|)e!PC~+jl>IJkR-^bMEJNu5+&Ix)0I-M9TqyKp=oV8I3;xdxDGd z9f+24#ySMJV_bdz`hZIYdZIJB)s2WSmIK}F-Z;0_LJ&iER?etaI)Di_m^j$%WGy4< z>2+7Ty`f|2iwC}8%DWc(^_m`H64AWefV-3MTJkX}yz4G`l*i8su6SFq2O@8xa4eJQ zf+$g2bY?iDm(ao*T!@0{6pHGMPHQ}^@a1eB&XQ<7croo&PyNbPevd%7k@C5WdFbZV zYIP?@_vfK*h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5bk2 zb)NB0qG?U8MkkiIwi-#}G4=W8DebMunE0d7^kH{eBd?rNap?*>bBgE6(i2?a79>%Nq|l zrPBi5e9D?hO6EH_z2YEUz%VWTT3HJ>p0Kst|6!)}>SRKqRQ`%R(aU&TrnN=g?mM67 z(gEtB8uL%g5~ra2gi`V$4S+NpfZdzq-WwJ5Ci(aHw|nLOEPD&ezh_~i{FjntPZ7C$ z7u%m@Z%IZiK6k^CBGrG-@{gtH{)BrCom$E5hAqY7sV2U^uG^nsuUAlwe>c48_LTwq zr|uOys+sJ@g@gZF&0o^CfAU@(pz7gn^w9sD{4eUbKhIv0QB`9%mMP6W8nS=l-ZMkx c;BJgD{v#ui1_!{@K?f<1B}KjTn5eD)04KiKGXMYp literal 0 HcmV?d00001 diff --git a/src/EPPlus.Extensions.Tests/packages.config b/src/EPPlus.Extensions.Tests/packages.config index 1506b15..3c3a05f 100644 --- a/src/EPPlus.Extensions.Tests/packages.config +++ b/src/EPPlus.Extensions.Tests/packages.config @@ -1,5 +1,6 @@  + \ No newline at end of file diff --git a/src/EPPlus.Extensions.sln b/src/EPPlus.Extensions.sln index 5137ffc..5d4d6ea 100644 --- a/src/EPPlus.Extensions.sln +++ b/src/EPPlus.Extensions.sln @@ -1,10 +1,12 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EPPlus.Extensions", "EPPlus.Extensions\EPPlus.Extensions.csproj", "{03756BE7-6CC0-4D3E-80CF-3F7DB49BC77A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EPPlus.Extensions.Tests", "EPPlus.Extensions.Tests\EPPlus.Extensions.Tests.csproj", "{2CCC31A1-9647-43EC-8179-ACC7AB005FF2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {03756BE7-6CC0-4D3E-80CF-3F7DB49BC77A}.Debug|Any CPU.Build.0 = Debug|Any CPU {03756BE7-6CC0-4D3E-80CF-3F7DB49BC77A}.Release|Any CPU.ActiveCfg = Release|Any CPU {03756BE7-6CC0-4D3E-80CF-3F7DB49BC77A}.Release|Any CPU.Build.0 = Release|Any CPU + {2CCC31A1-9647-43EC-8179-ACC7AB005FF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2CCC31A1-9647-43EC-8179-ACC7AB005FF2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2CCC31A1-9647-43EC-8179-ACC7AB005FF2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2CCC31A1-9647-43EC-8179-ACC7AB005FF2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/EPPlus.Extensions/EPPlusExtensions.cs b/src/EPPlus.Extensions/EPPlusExtensions.cs index dd18749..7f2090e 100644 --- a/src/EPPlus.Extensions/EPPlusExtensions.cs +++ b/src/EPPlus.Extensions/EPPlusExtensions.cs @@ -31,7 +31,7 @@ public static DataSet ToDataSet(this ExcelPackage package, int headerRow = 0) { if (headerRow < 0) { - throw new ArgumentException("headerRow must be 0 or greater."); + throw new ArgumentOutOfRangeException(nameof(headerRow), headerRow, "Must be 0 or greater."); } var result = new DataSet();