ソースを参照

Merge pull request #49 from janbernloehr/nunit

Changed Relative Paths in Unit Tests
master
PrzemyslawKlys 9年前
コミット
6395a738fb
5個のファイルの変更10行の追加41行の削除
  1. 1
    6
      DocX.sln
  2. 0
    7
      DocX.vsmdi
  3. 0
    10
      Local.testsettings
  4. 0
    9
      TraceAndTestImpact.testsettings
  5. 9
    9
      UnitTests/DocXUnitTests.cs

+ 1
- 6
DocX.sln ファイルの表示

@@ -1,14 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DF41F5CE-8BCB-40CC-835F-54A3DB7D802F}"
ProjectSection(SolutionItems) = preProject
DocX.vsmdi = DocX.vsmdi
Local.testsettings = Local.testsettings
TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocX", "DocX\DocX.csproj", "{E863D072-AA8B-4108-B5F1-785241B37F67}"
EndProject

+ 0
- 7
DocX.vsmdi ファイルの表示

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<TestList name="List1" id="5acd79f2-f7f8-4088-87d0-23aa5f6cdeae" parentListId="8c43106b-9dc1-4907-a29f-aa66a61bf5b6" />
<TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
<RunConfiguration id="95fe5b2d-3af6-4f81-a23a-86c45b1f95a1" name="Local" storage="local.testsettings" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</TestList>
</TestLists>

+ 0
- 10
Local.testsettings ファイルの表示

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Local" id="95fe5b2d-3af6-4f81-a23a-86c45b1f95a1" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>These are default test settings for a local test run.</Description>
<Deployment enabled="false" />
<Execution>
<TestTypeSpecific />
<AgentRule name="Execution Agents">
</AgentRule>
</Execution>
</TestSettings>

+ 0
- 9
TraceAndTestImpact.testsettings ファイルの表示

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Trace and Test Impact" id="ddea5473-b23c-4e19-9fc6-bd924ed99e12" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>These are test settings for Trace and Test Impact.</Description>
<Execution>
<TestTypeSpecific />
<AgentRule name="Execution Agents">
</AgentRule>
</Execution>
</TestSettings>

+ 9
- 9
UnitTests/DocXUnitTests.cs ファイルの表示

@@ -1498,12 +1498,12 @@ namespace UnitTests
[Test]
public void Saving_and_loading_a_template_should_work()
{
using (DocX document = DocX.Create("test template.dotx", DocumentTypes.Template))
using (DocX document = DocX.Create(Path.Combine(_directoryDocuments, "test template.dotx"), DocumentTypes.Template))
{
document.InsertParagraph("hello, this is a paragraph");
document.Save();
}
using (DocX document = DocX.Load("test template.dotx"))
using (DocX document = DocX.Load(Path.Combine(_directoryDocuments, "test template.dotx")))
{
Assert.IsTrue(document.Paragraphs.Count > 0);
}
@@ -1866,7 +1866,7 @@ namespace UnitTests
[Test]
public void IfPreviousElementIsAListThenAddingANewListContinuesThePreviousList()
{
using (DocX document = DocX.Create("TestAddListToPreviousList.docx"))
using (DocX document = DocX.Create(Path.Combine(_directoryDocuments, "TestAddListToPreviousList.docx")))
{
var list = document.AddList("List Text");
document.AddListItem(list, "List Text2");
@@ -1957,7 +1957,7 @@ namespace UnitTests
[Test]
public void WhenICreateAHeaderItShouldHaveAStyle()
{
using (var document = DocX.Create("CreateHeaderElement.docx"))
using (var document = DocX.Create(Path.Combine(_directoryDocuments, "CreateHeaderElement.docx")))
{
document.InsertParagraph("Header Text 1").StyleName = "Header1";
Assert.IsNotNull(document.styles.Root.Descendants().FirstOrDefault(d => d.GetAttribute(DocX.w + "styleId").ToLowerInvariant() == "heading1"));
@@ -1968,7 +1968,7 @@ namespace UnitTests
[Test]
public void ParagraphAppendHyperLink_ParagraphIsListItem_ShouldNotThrow()
{
using (var document = DocX.Create("HyperlinkList.docx"))
using (var document = DocX.Create(Path.Combine(_directoryDocuments, "HyperlinkList.docx")))
{
var list = document.AddList("Item 1", listType: ListItemType.Numbered);
document.AddListItem(list, "Item 2");
@@ -2037,7 +2037,7 @@ namespace UnitTests
[Test]
public void InsertingANextPageBreakShouldAddADocumentSection()
{
using (DocX document = DocX.Create("SectionPageBreak.docx"))
using (DocX document = DocX.Create(Path.Combine(_directoryDocuments, "SectionPageBreak.docx")))
{
document.InsertSectionPageBreak();
@@ -2050,7 +2050,7 @@ namespace UnitTests
[Test]
public void InsertANextPageBreakWithParagraphTextsShouldAddProperParagraphsToProperSections()
{
using (DocX document = DocX.Create("SectionPageBreakWithParagraphs.docx"))
using (DocX document = DocX.Create(Path.Combine(_directoryDocuments, "SectionPageBreakWithParagraphs.docx")))
{
document.InsertParagraph("First paragraph.");
document.InsertParagraph("Second paragraph.");
@@ -2070,7 +2070,7 @@ namespace UnitTests
[Test]
public void WhenAFontFamilyIsSpecifiedForAParagraphItShouldSetTheFontOfTheParagraphTextToTheFontFamily()
{
using (DocX document = DocX.Create("FontTest.docx"))
using (DocX document = DocX.Create(Path.Combine(_directoryDocuments, "FontTest.docx")))
{
Paragraph p = document.InsertParagraph();
@@ -2172,7 +2172,7 @@ namespace UnitTests
[Test]
public void GenerateHeadingTestDocument()
{
using (DocX document = DocX.Create(@"Document Header Test.docx"))
using (DocX document = DocX.Create(Path.Combine(_directoryDocuments, @"Document Header Test.docx")))
{
foreach (HeadingType heading in (HeadingType[])Enum.GetValues(typeof(HeadingType)))

読み込み中…
キャンセル
保存