diff --git a/ClosedXML/ClosedXML.sln b/ClosedXML/ClosedXML.sln index c619cc0..fd10e4a 100644 --- a/ClosedXML/ClosedXML.sln +++ b/ClosedXML/ClosedXML.sln @@ -3,25 +3,75 @@ # Visual Studio 2010 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClosedXML", "ClosedXML\ClosedXML.csproj", "{BD5E6BFE-E837-4A35-BCA9-39667D873A20}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClosedXML_Sandbox", "ClosedXML_Sandbox\ClosedXML_Sandbox.csproj", "{38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClosedXML_Test", "ClosedXML_Test\ClosedXML_Test.csproj", "{D41B4F43-AB44-4236-B959-D508D259F4A7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5C94E22C-85AA-48FD-B082-CF929FFC6C31}" + ProjectSection(SolutionItems) = preProject + ClosedXML.vsmdi = ClosedXML.vsmdi + Local.testsettings = Local.testsettings + TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings + EndProjectSection +EndProject Global GlobalSection(TeamFoundationVersionControl) = preSolution - SccNumberOfProjects = 2 + SccNumberOfProjects = 4 SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C} SccTeamFoundationServer = https://tfs09.codeplex.com/ SccLocalPath0 = . SccProjectUniqueName1 = ClosedXML\\ClosedXML.csproj SccProjectName1 = ClosedXML SccLocalPath1 = ClosedXML + SccProjectUniqueName2 = ClosedXML_Sandbox\\ClosedXML_Sandbox.csproj + SccProjectName2 = ClosedXML_Sandbox + SccLocalPath2 = ClosedXML_Sandbox + SccProjectUniqueName3 = ClosedXML_Test\\ClosedXML_Test.csproj + SccProjectName3 = ClosedXML_Test + SccLocalPath3 = ClosedXML_Test + EndGlobalSection + GlobalSection(TestCaseManagementSettings) = postSolution + CategoryFile = ClosedXML.vsmdi EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Debug|x86.ActiveCfg = Debug|Any CPU {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|Any CPU.ActiveCfg = Release|Any CPU {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|Any CPU.Build.0 = Release|Any CPU + {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|x86.ActiveCfg = Release|Any CPU + {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Debug|Any CPU.ActiveCfg = Debug|x86 + {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Debug|x86.ActiveCfg = Debug|x86 + {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Debug|x86.Build.0 = Debug|x86 + {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Release|Any CPU.ActiveCfg = Release|x86 + {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Release|Mixed Platforms.Build.0 = Release|x86 + {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Release|x86.ActiveCfg = Release|x86 + {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Release|x86.Build.0 = Release|x86 + {D41B4F43-AB44-4236-B959-D508D259F4A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D41B4F43-AB44-4236-B959-D508D259F4A7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D41B4F43-AB44-4236-B959-D508D259F4A7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D41B4F43-AB44-4236-B959-D508D259F4A7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D41B4F43-AB44-4236-B959-D508D259F4A7}.Debug|x86.ActiveCfg = Debug|Any CPU + {D41B4F43-AB44-4236-B959-D508D259F4A7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D41B4F43-AB44-4236-B959-D508D259F4A7}.Release|Any CPU.Build.0 = Release|Any CPU + {D41B4F43-AB44-4236-B959-D508D259F4A7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D41B4F43-AB44-4236-B959-D508D259F4A7}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D41B4F43-AB44-4236-B959-D508D259F4A7}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ClosedXML/ClosedXML.vsmdi b/ClosedXML/ClosedXML.vsmdi new file mode 100644 index 0000000..2acf62a --- /dev/null +++ b/ClosedXML/ClosedXML.vsmdi @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ClosedXML/ClosedXML/ClosedXML.csproj b/ClosedXML/ClosedXML/ClosedXML.csproj index 8517855..ba4c496 100644 --- a/ClosedXML/ClosedXML/ClosedXML.csproj +++ b/ClosedXML/ClosedXML/ClosedXML.csproj @@ -46,16 +46,21 @@ - - - - + + + + + + - + - + + + + + \ No newline at end of file diff --git a/ClosedXML/ClosedXML_Sandbox/ClosedXML_Sandbox.csproj.vspscc b/ClosedXML/ClosedXML_Sandbox/ClosedXML_Sandbox.csproj.vspscc new file mode 100644 index 0000000..feffdec --- /dev/null +++ b/ClosedXML/ClosedXML_Sandbox/ClosedXML_Sandbox.csproj.vspscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +} diff --git a/ClosedXML/ClosedXML_Sandbox/Program.cs b/ClosedXML/ClosedXML_Sandbox/Program.cs new file mode 100644 index 0000000..c77b7ec --- /dev/null +++ b/ClosedXML/ClosedXML_Sandbox/Program.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using ClosedXML.Excel; + +namespace ClosedXML_Sandbox +{ + class Program + { + static void Main(string[] args) + { + var wbExample = new XLWorkbook(@"c:\Example.xlsx"); + var wsWorld = wbExample.Worksheets.Add("World"); + var wsNameList = wbExample.Worksheets.Add("Name List"); + var wsDeleteMe = wbExample.Worksheets.Add("Delete Me"); + + + + var a1 = wsNameList.Cell("A1"); + var a2 = wsNameList.Cell("A2"); + a1.Value = "Hello!"; + wbExample.Save(); + // a2.Font.Bold = true; + } + } +} diff --git a/ClosedXML/ClosedXML_Sandbox/Properties/AssemblyInfo.cs b/ClosedXML/ClosedXML_Sandbox/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..942db94 --- /dev/null +++ b/ClosedXML/ClosedXML_Sandbox/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ClosedXML_Sandbox")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("ClosedXML_Sandbox")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7a3783fd-4e1b-4c17-a745-e6bbb593bd45")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ClosedXML/ClosedXML_Test/ClosedXML_Test.csproj b/ClosedXML/ClosedXML_Test/ClosedXML_Test.csproj new file mode 100644 index 0000000..4872842 --- /dev/null +++ b/ClosedXML/ClosedXML_Test/ClosedXML_Test.csproj @@ -0,0 +1,77 @@ + + + + Debug + AnyCPU + + + 2.0 + {D41B4F43-AB44-4236-B959-D508D259F4A7} + Library + Properties + ClosedXML_Test + ClosedXML_Test + v4.0 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + SAK + SAK + SAK + SAK + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + 3.5 + + + + + + + + + + False + + + + + + + + + + {BD5E6BFE-E837-4A35-BCA9-39667D873A20} + ClosedXML + + + + + \ No newline at end of file diff --git a/ClosedXML/ClosedXML_Test/ClosedXML_Test.csproj.vspscc b/ClosedXML/ClosedXML_Test/ClosedXML_Test.csproj.vspscc new file mode 100644 index 0000000..feffdec --- /dev/null +++ b/ClosedXML/ClosedXML_Test/ClosedXML_Test.csproj.vspscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +} diff --git a/ClosedXML/ClosedXML_Test/Properties/AssemblyInfo.cs b/ClosedXML/ClosedXML_Test/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7a3a012 --- /dev/null +++ b/ClosedXML/ClosedXML_Test/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ClosedXML_Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("ClosedXML_Test")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("6acc873b-86e7-4c3d-89e6-3e409183c5ec")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ClosedXML/ClosedXML_Test/XLWorkbookTest.cs b/ClosedXML/ClosedXML_Test/XLWorkbookTest.cs new file mode 100644 index 0000000..b939215 --- /dev/null +++ b/ClosedXML/ClosedXML_Test/XLWorkbookTest.cs @@ -0,0 +1,81 @@ +using ClosedXML.Excel; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.IO; + +namespace ClosedXML_Test +{ + + + /// + ///This is a test class for XLWorkbookTest and is intended + ///to contain all XLWorkbookTest Unit Tests + /// + [TestClass()] + public class XLWorkbookTest + { + + + private TestContext testContextInstance; + + /// + ///Gets or sets the test context which provides + ///information about and functionality for the current test run. + /// + public TestContext TestContext + { + get + { + return testContextInstance; + } + set + { + testContextInstance = value; + } + } + + #region Additional test attributes + // + //You can use the following additional attributes as you write your tests: + // + //Use ClassInitialize to run code before running the first test in the class + //[ClassInitialize()] + //public static void MyClassInitialize(TestContext testContext) + //{ + //} + // + //Use ClassCleanup to run code after all tests in a class have run + //[ClassCleanup()] + //public static void MyClassCleanup() + //{ + //} + // + //Use TestInitialize to run code before running each test + //[TestInitialize()] + //public void MyTestInitialize() + //{ + //} + // + //Use TestCleanup to run code after each test has run + //[TestCleanup()] + //public void MyTestCleanup() + //{ + //} + // + #endregion + + + /// + ///A test for XLWorkbook Constructor + /// + [TestMethod()] + public void XLWorkbookConstructorTest() + { + FileInfo fi = new FileInfo("Test.xlsx"); + XLWorkbook target = new XLWorkbook(fi.FullName); + + Assert.AreEqual(target.Name, fi.Name); + Assert.AreEqual(target.FullName, fi.FullName); + } + } +} diff --git a/ClosedXML/ClosedXML_Test/XLWorksheetsTest.cs b/ClosedXML/ClosedXML_Test/XLWorksheetsTest.cs new file mode 100644 index 0000000..d349068 --- /dev/null +++ b/ClosedXML/ClosedXML_Test/XLWorksheetsTest.cs @@ -0,0 +1,99 @@ +using ClosedXML.Excel; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; + +namespace ClosedXML_Test +{ + + /// + ///This is a test class for XLWorksheetsTest and is intended + ///to contain all XLWorksheetsTest Unit Tests + /// + [TestClass()] + public class XLWorksheetsTest + { + + + private TestContext testContextInstance; + + /// + ///Gets or sets the test context which provides + ///information about and functionality for the current test run. + /// + public TestContext TestContext + { + get + { + return testContextInstance; + } + set + { + testContextInstance = value; + } + } + + #region Additional test attributes + // + //You can use the following additional attributes as you write your tests: + // + //Use ClassInitialize to run code before running the first test in the class + //[ClassInitialize()] + //public static void MyClassInitialize(TestContext testContext) + //{ + //} + // + //Use ClassCleanup to run code after all tests in a class have run + //[ClassCleanup()] + //public static void MyClassCleanup() + //{ + //} + // + //Use TestInitialize to run code before running each test + //[TestInitialize()] + //public void MyTestInitialize() + //{ + //} + // + //Use TestCleanup to run code after each test has run + //[TestCleanup()] + //public void MyTestCleanup() + //{ + //} + // + #endregion + + + /// + ///A test for XLWorksheets Constructor + /// + [TestMethod()] + public void XLWorksheets_Constructor_Test() + { + var wbExample = new XLWorkbook(@"c:\Example.xlsx"); + XLWorksheets target = new XLWorksheets(wbExample); + + } + + [TestMethod()] + public void XLWorksheets_Count0_Add1_Add2_Delete1_Count1_Test() + { + var wbExample = new XLWorkbook(@"c:\Example.xlsx"); + XLWorksheets target = new XLWorksheets(wbExample); + + Assert.AreEqual(target.Count, 0U); + + target.Add("Sheet1"); + + Assert.AreEqual(target.Count, 1U); + + target.Add("Sheet2"); + + Assert.AreEqual(target.Count, 2U); + + target.Delete("Sheet2"); + + Assert.AreEqual(target.Count, 1U); + + } + } +} diff --git a/ClosedXML/Local.testsettings b/ClosedXML/Local.testsettings new file mode 100644 index 0000000..49edf89 --- /dev/null +++ b/ClosedXML/Local.testsettings @@ -0,0 +1,10 @@ + + + These are default test settings for a local test run. + + + + + + + \ No newline at end of file diff --git a/ClosedXML/TraceAndTestImpact.testsettings b/ClosedXML/TraceAndTestImpact.testsettings new file mode 100644 index 0000000..0792b9b --- /dev/null +++ b/ClosedXML/TraceAndTestImpact.testsettings @@ -0,0 +1,21 @@ + + + These are test settings for Trace and Test Impact. + + + + + + + + + + + + + + + + + + \ No newline at end of file