Here are the examples of the csharp api NUnit.Framework.Is.EqualTo(object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3601 Examples
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Parameter_without_default_value_but_equalSign()
{
var keyValue = ParameterSection.Parameter.Parse("key=");
replacedert.That(keyValue.Key, Is.EqualTo("key"));
replacedert.That(keyValue.Value, Is.EqualTo(""));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Parameter_without_default_value()
{
var keyValue = ParameterSection.Parameter.Parse("key");
replacedert.That(keyValue.Key, Is.EqualTo("key"));
replacedert.That(keyValue.Value, Is.EqualTo(""));
}
19
View Source File : TemplateManagerTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Verify_retrieve_of_template()
{
var sut = new TemplateManager(GetTemplateFolder("1"));
var template = sut.GetWordDefinitionTemplate("TemplateA");
replacedert.That(template, Is.Not.Null);
replacedert.That(template.Name, Is.EqualTo("TemplateA"));
var expected = Path.Combine(GetTemplateFolder("1"), "TemplateA", "Product Backlog Item.docx");
replacedert.That(template.GetTemplateFor("Product BACKLOG Item"), Is.EqualTo(expected));
}
19
View Source File : WordTemplateTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Verify_scan_folder_grab_name()
{
WordTemplateFolderManager sut = CreateSutForTemplate_1_A();
replacedert.That(sut.Name, Is.EqualTo("TemplateA"));
}
19
View Source File : WordTemplateTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Verify_correctly_grab_docx_name()
{
WordTemplateFolderManager sut = CreateSutForTemplate_1_A();
var expected = Path.Combine(GetTemplate1AFolder(), "Product Backlog Item.docx");
replacedert.That(sut.GetTemplateFor("Product Backlog Item"), Is.EqualTo(expected));
}
19
View Source File : WordTemplateTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Verify_default_name_if_Work_item_type_does_not_esixts()
{
WordTemplateFolderManager sut = CreateSutForTemplate_1_A();
var expected = Path.Combine(GetTemplate1AFolder(), "WorkItem.docx");
replacedert.That(sut.GetTemplateFor("This type does not exists"), Is.EqualTo(expected));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Parameter_with_default_value()
{
var keyValue = ParameterSection.Parameter.Parse("key=defValue");
replacedert.That(keyValue.Key, Is.EqualTo("key"));
replacedert.That(keyValue.Value, Is.EqualTo("defValue"));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Parameter_with_default_value_and_spaces()
{
var keyValue = ParameterSection.Parameter.Parse("key = defValue");
replacedert.That(keyValue.Key, Is.EqualTo("key"));
replacedert.That(keyValue.Value, Is.EqualTo("defValue"));
}
19
View Source File : WordTemplateTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Verify_grab_docx_name_is_not_case_sensitive()
{
WordTemplateFolderManager sut = CreateSutForTemplate_1_A();
var expected = Path.Combine(GetTemplate1AFolder(), "Product Backlog Item.docx");
replacedert.That(sut.GetTemplateFor("Product BACKLOG Item"), Is.EqualTo(expected));
}
19
View Source File : HtmlAgilityToolkitExtensionTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void SelectivelyRemoveSingleTag()
{
var doc = new HtmlDoreplacedent();
doc.LoadHtml("<p>paragraph</p><p>multiple</p>");
doc.RemoveTags(null, "p");
replacedert.That(doc.DoreplacedentNode.InnerHtml, Is.EqualTo("paragraphmultiple"));
}
19
View Source File : HtmlAgilityToolkitExtensionTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void SelectivelyRemoveSingleTagWithPrefix()
{
var doc = new HtmlDoreplacedent();
doc.LoadHtml("Prefix<p>paragraph</p><p>multiple</p>");
doc.RemoveTags(null, "p");
replacedert.That(doc.DoreplacedentNode.InnerHtml, Is.EqualTo("Prefixparagraphmultiple"));
}
19
View Source File : HtmlAgilityToolkitExtensionTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void SelectivelyRemoveSingleTagWithClosingSubsreplacedution()
{
var doc = new HtmlDoreplacedent();
doc.LoadHtml("<p>paragraph</p><p>multiple</p>");
doc.RemoveTags(doc.CreateElement("br"), "p");
replacedert.That(doc.DoreplacedentNode.InnerHtml, Is.EqualTo("paragraph<br>multiple<br>"));
}
19
View Source File : HtmlAgilityToolkitExtensionTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void SelectivelyRemoveSingleTagMaintainInner()
{
var doc = new HtmlDoreplacedent();
doc.LoadHtml("<p>paragraph <strong>strong</strong></p><p>multiple</p>");
doc.RemoveTags(null, "p");
replacedert.That(doc.DoreplacedentNode.InnerHtml, Is.EqualTo("paragraph <strong>strong</strong>multiple"));
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Basic_Parsing_of_definition_for_excel_Export()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[definition]]
type=excel
[[parameters]]
TargetDateStart=2019-06-01
TargetDateEnd=2019-10-01
[[parameterDefinition]]");
replacedert.That(def.Type, Is.EqualTo(TemplateType.Excel));
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Default_template_type_is_word()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[parameters]]
TargetDateStart=2019-06-01
TargetDateEnd=2019-10-01
[[parameterDefinition]]");
replacedert.That(def.Type, Is.EqualTo(TemplateType.Word));
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Support_for_base_template()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[definition]]
type=excel
baseTemplate=test.xlsx
[[parameters]]
TargetDateStart=2019-06-01
TargetDateEnd=2019-10-01
[[parameterDefinition]]");
replacedert.That(def.BaseTemplate, Is.EqualTo ("test.xlsx"));
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Basic_Parsing_of_Parameters_with_default_value_returns_parameter_section()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[parameters]]
parama=2017-01-01
paramb=2019-04-31");
replacedert.That(def.ParameterSection, Is.Not.Null);
var paramA = def.ParameterSection.Parameters["parama"];
replacedert.That(paramA, Is.EqualTo("2017-01-01"));
var paramB = def.ParameterSection.Parameters["paramb"];
replacedert.That(paramB, Is.EqualTo("2019-04-31"));
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Basic_Parsing_of_Parameters_with_allowed_values()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[parameterDefinition]]
parama=string/A|B|C
paramb=datetime");
replacedert.That(def.ParameterDefinition, Is.Not.Null);
var paramA = def.ParameterDefinition["parama"];
replacedert.That(paramA.Type, Is.EqualTo("string"));
replacedert.That(paramA.AllowedValues, Is.EquivalentTo(new[] { "A", "B", "C" }));
var paramb = def.ParameterDefinition["paramb"];
replacedert.That(paramb.Type, Is.EqualTo("datetime"));
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Basic_Parsing_of_array_parameter()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[arrayParameters]]
tags");
replacedert.That(def.ArrayParameterSection.ArrayParameters.Count, Is.EqualTo(1));
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Basic_Parsing_of_array_parameter_followed_by_other_params()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[arrayParameters]]
tags=te,tr,ty
[[parameters]]
TargetDateStart=2019-01-01");
replacedert.That(def.ArrayParameterSection.ArrayParameters.Count, Is.EqualTo(1));
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Parsing_two_Sections()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[parameters]]
parama
paramb
[[static]]
filename: bla.txt");
replacedert.That(def.AllSections.Length, Is.EqualTo(2));
replacedert.That(def.AllSections[0], Is.InstanceOf<ParameterSection>());
replacedert.That(def.AllSections[1], Is.InstanceOf<StaticWordSection>());
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Valid_static_section()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[static]]
filename: bla.docx
pageBreak: true");
var staticSection = def.AllSections.Single() as StaticWordSection;
replacedert.That(staticSection.FileName, Is.EqualTo("bla.docx"));
replacedert.That(staticSection.PageBreak, Is.EqualTo(true));
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Valid_query_section()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[query]]
name: TestQueryName
query: ""SELECT * FROM WorkItems Where [System.AreaPath] UNDER '{areaPath}' AND [System.IterationPath] UNDER '{iterationPath}'""
template/Product Backlog Item: pbix.docx
template/Bug: bugaa.docx
");
var querySection = def.AllSections.Single() as QuerySection;
replacedert.That(querySection.Name, Is.EqualTo("TestQueryName"));
replacedert.That(querySection.Query, Is.EqualTo("SELECT * FROM WorkItems Where [System.AreaPath] UNDER '{areaPath}' AND [System.IterationPath] UNDER '{iterationPath}'"));
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Query_section_parse_specific_workItem_templates()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[query]]
query: ""SELECT * FROM WorkItems Where [System.AreaPath] UNDER '{areaPath}' AND [System.IterationPath] UNDER '{iterationPath}'""
template/Product Backlog Item: pbix.docx
template/Bug: bugaa.docx
limit: 1
");
var querySection = def.AllSections.Single() as QuerySection;
replacedert.That(querySection.GetTemplateForWorkItem("Product Backlog Item"), Is.EqualTo("pbix.docx"));
replacedert.That(querySection.GetTemplateForWorkItem("Task"), Is.EqualTo(null));
replacedert.That(querySection.Limit, Is.EqualTo(1));
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Query_section_parse_filter_work_item_by_type()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[query]]
query: ""SELECT * FROM WorkItems Where [System.AreaPath] UNDER '{areaPath}' AND [System.IterationPath] UNDER '{iterationPath}'""
template/Product Backlog Item: pbix.docx
template/Bug: bugaa.docx
limit: 1
workItemTypes: Product Backlog Item,Feature
");
var querySection = def.AllSections.Single() as QuerySection;
replacedert.That(querySection.GetTemplateForWorkItem("Product Backlog Item"), Is.EqualTo("pbix.docx"));
replacedert.That(querySection.GetTemplateForWorkItem("Task"), Is.EqualTo(null));
replacedert.That(querySection.WorkItemTypes, Is.EquivalentTo(new[] { "Product Backlog Item", "Feature" }));
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Query_section_without_limit_default_to_max_value()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[query]]
query: ""SELECT * FROM WorkItems Where [System.AreaPath] UNDER '{areaPath}' AND [System.IterationPath] UNDER '{iterationPath}'""
");
var querySection = def.AllSections.Single() as QuerySection;
replacedert.That(querySection.Limit, Is.EqualTo(Int32.MaxValue));
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Valid_query_section_with_table_file()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[query]]
query: ""SELECT * FROM WorkItems Where [System.AreaPath] UNDER '{areaPath}' AND [System.IterationPath] UNDER '{iterationPath}'""
tableTemplate: table.docx
");
var querySection = def.AllSections.Single() as QuerySection;
replacedert.That(querySection.TableTemplate, Is.EqualTo("table.docx"));
}
19
View Source File : BasicParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Valid_parametric_query()
{
var sut = new ConfigurationParser();
TemplateDefinition def = sut.ParseTemplateDefinition(
@"[[query]]
query: ""SELECT
*
FROM workitems
WHERE
[System.TeamProject] = @project
AND [System.WorkItemType] = 'Product Backlog Item'
AND [System.IterationPath] = '{iterationPath}'""
parameterSet: iterationPath=Zoalord Insurance\Release 1\Sprint 4
parameterSet: iterationPath=Zoalord Insurance\Release 1\Sprint 5
parameterSet: iterationPath=Zoalord Insurance\Release 1\Sprint 6
");
var querySection = def.AllSections.Single() as QuerySection;
replacedert.That(querySection.QueryParameters.Count, Is.EqualTo(3));
replacedert.That(querySection.QueryParameters[0]["iterationPath"], Is.EqualTo(@"Zoalord Insurance\Release 1\Sprint 4"));
replacedert.That(querySection.QueryParameters[1]["iterationPath"], Is.EqualTo(@"Zoalord Insurance\Release 1\Sprint 5"));
replacedert.That(querySection.QueryParameters[2]["iterationPath"], Is.EqualTo(@"Zoalord Insurance\Release 1\Sprint 6"));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Basic_KeyValue()
{
var keyValue = ConfigurationParser.KeyValue.Parse("key: value");
replacedert.That(keyValue.Key, Is.EqualTo("key"));
replacedert.That(keyValue.Value, Is.EqualTo("value"));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Can_have_more_than_value_with_Single_key()
{
var keyValues = ConfigurationParser.KeyValueList.Parse("key: value\nkey: value2").ToArray();
replacedert.That(keyValues.Length, Is.EqualTo(2));
replacedert.That(keyValues[0].Key, Is.EqualTo("key"));
replacedert.That(keyValues[0].Value, Is.EqualTo("value"));
replacedert.That(keyValues[1].Key, Is.EqualTo("key"));
replacedert.That(keyValues[1].Value, Is.EqualTo("value2"));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Basic_Multiple_KeyValue()
{
var keyValues = ConfigurationParser.KeyValueList.Parse("key: value\nkey2: value2").ToArray();
replacedert.That(keyValues.Length, Is.EqualTo(2));
replacedert.That(keyValues[0].Key, Is.EqualTo("key"));
replacedert.That(keyValues[0].Value, Is.EqualTo("value"));
replacedert.That(keyValues[1].Key, Is.EqualTo("key2"));
replacedert.That(keyValues[1].Value, Is.EqualTo("value2"));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Basic_KeyValue_resilient_to_spaces()
{
var keyValue = ConfigurationParser.KeyValue.Parse("key : value ");
replacedert.That(keyValue.Key, Is.EqualTo("key"));
replacedert.That(keyValue.Value, Is.EqualTo("value"));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void SingleLine_with_semicolon()
{
var keyValue = ConfigurationParser.KeyValue.Parse("key: value:with:semicolon");
replacedert.That(keyValue.Key, Is.EqualTo("key"));
replacedert.That(keyValue.Value, Is.EqualTo("value:with:semicolon"));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void MultiLine_key_value()
{
var keyValue = ConfigurationParser.MultiLineKeyValue.Parse(@"key: ""value
value2
value3""");
replacedert.That(keyValue.Key, Is.EqualTo("key"));
replacedert.That(keyValue.Value, Is.EqualTo("value\r\n\r\nvalue2\r\n\r\nvalue3"));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void MultiLine_key_value_query()
{
var keyValue = ConfigurationParser.MultiLineKeyValue.Parse(
@"query: ""SELECT
*
FROM workitems
WHERE
[System.TeamProject] = @project
AND [System.WorkItemType] = 'Product Backlog Item'
AND [System.IterationPath] = '{iterationPath}'""");
replacedert.That(keyValue.Key, Is.EqualTo("query"));
replacedert.That(keyValue.Value.Contains("[System.TeamProject] = @project"));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void MultiLine_key_value_query_plus_parameter()
{
var keyValue = ConfigurationParser.MultiLineKeyValue.Parse(
@"query: ""SELECT
*
FROM workitems
WHERE
[System.TeamProject] = @project
AND [System.WorkItemType] = 'Product Backlog Item'
AND [System.IterationPath] = '{iterationPath}'""
queryParameter: test");
replacedert.That(keyValue.Key, Is.EqualTo("query"));
replacedert.That(keyValue.Value.Contains("[System.TeamProject] = @project"));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void MultiLine_key_value_can_contain_square_bracket()
{
var keyValue = ConfigurationParser.MultiLineKeyValue.Parse(@"key: ""value
[value2]
value3""");
replacedert.That(keyValue.Key, Is.EqualTo("key"));
replacedert.That(keyValue.Value, Is.EqualTo("value\r\n[value2]\r\nvalue3"));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void MultiLine_key_value_can_contain_semicolon()
{
var keyValue = ConfigurationParser.MultiLineKeyValue.Parse(@"key: ""value
value:[with]:semicolon
:value3""");
replacedert.That(keyValue.Key, Is.EqualTo("key"));
replacedert.That(keyValue.Value, Is.EqualTo("value\r\nvalue:[with]:semicolon\r\n:value3"));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Single_parameter_set()
{
var parameterList = ConfigurationParser.ParameterSetList.Parse(@"param1=a|param2=b").ToArray();
replacedert.That(parameterList.Length, Is.EqualTo(2));
replacedert.That(parameterList[0].Key, Is.EqualTo("param1"));
replacedert.That(parameterList[0].Value, Is.EqualTo("a"));
replacedert.That(parameterList[1].Key, Is.EqualTo("param2"));
replacedert.That(parameterList[1].Value, Is.EqualTo("b"));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Parameter_without_default_value_and_other_line()
{
var keyValue = ParameterSection.Parameter.Parse(@"key
otherline");
replacedert.That(keyValue.Key, Is.EqualTo("key"));
replacedert.That(keyValue.Value, Is.EqualTo(""));
}
19
View Source File : SingleSectionParserTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Parameter_without_default_value_and_other_line_many_parse()
{
var keyValue = ParameterSection.Parser.Parse(@"key
otherline");
replacedert.That(keyValue.Parameters.Count, Is.EqualTo(2));
replacedert.That(keyValue.Parameters.Keys, Is.EquivalentTo(new[] { "key", "otherline"}));
}
19
View Source File : TemplateManagerTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Verify_correct_number_of_templates_is_scanned()
{
var sut = new TemplateManager(GetTemplateFolder("1"));
replacedert.That(sut.TemplateCount, Is.EqualTo(4));
}
19
View Source File : TemplateManagerTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Verify_auto_parsing_of_structure_file()
{
var sut = new TemplateManager(GetTemplateFolder("1"));
var template = sut.GetWordDefinitionTemplate("TemplateStructure");
replacedert.That(template, Is.Not.Null);
replacedert.That(template.TemplateDefinition, Is.Not.Null);
replacedert.That(template.TemplateDefinition.AllSections.Length, Is.EqualTo(2));
replacedert.That(template.TemplateDefinition.ParameterSection.Parameters.Keys, Is.EquivalentTo(new[] { "test", "blah" }));
}
19
View Source File : TemplateManagerTests.cs
License : MIT License
Project Creator : alkampfergit
License : MIT License
Project Creator : alkampfergit
[Test]
public void Verify_template_with_syntax()
{
var sut = new TemplateManager(GetTemplateFolder("1"));
var template = sut.GetWordDefinitionTemplate("TemplateA");
replacedert.That(template, Is.Not.Null);
replacedert.That(template.Name, Is.EqualTo("TemplateA"));
var expected = Path.Combine(GetTemplateFolder("1"), "TemplateA", "Product Backlog Item.docx");
replacedert.That(template.GetTemplateFor("Product BACKLOG Item"), Is.EqualTo(expected));
}
19
View Source File : TestFeaturePostProcessing.cs
License : MIT License
Project Creator : ar1st0crat
License : MIT License
Project Creator : ar1st0crat
[Test]
public void TestMeanNormalization()
{
FeaturePostProcessing.NormalizeMean(_feats);
replacedert.Multiple(() =>
{
replacedert.That(_feats[0], Is.EqualTo(new float[] { 0.8f, 0, -1, 1.6f, 2 }).Within(1e-5));
replacedert.That(_feats[1], Is.EqualTo(new float[] { -0.2f, 0, 0, -2.4f, 1 }).Within(1e-5));
replacedert.That(_feats[2], Is.EqualTo(new float[] { -0.2f, 0, 2, 1.6f, 0 }).Within(1e-5));
replacedert.That(_feats[3], Is.EqualTo(new float[] { -0.2f, 0, 0, -2.4f, -1 }).Within(1e-5));
replacedert.That(_feats[4], Is.EqualTo(new float[] { -0.2f, 0, -1, 1.6f, -2 }).Within(1e-5));
});
}
19
View Source File : TestFeaturePostProcessing.cs
License : MIT License
Project Creator : ar1st0crat
License : MIT License
Project Creator : ar1st0crat
[Test]
public void TestVarianceNormalization()
{
FeaturePostProcessing.NormalizeVariance(_feats, bias: 0);
replacedert.Multiple(() =>
{
replacedert.That(_feats[0], Is.EqualTo(new float[] { 2.5f, 2, 2.74f, 2.04f, 3.536f }).Within(1e-2));
replacedert.That(_feats[1], Is.EqualTo(new float[] { 0, 2, 3.65f, 0, 2.83f }).Within(1e-2));
replacedert.That(_feats[2], Is.EqualTo(new float[] { 0, 2, 5.48f, 2.04f, 2.12f }).Within(1e-2));
replacedert.That(_feats[3], Is.EqualTo(new float[] { 0, 2, 3.65f, 0, 1.41f }).Within(1e-2));
replacedert.That(_feats[4], Is.EqualTo(new float[] { 0, 2, 2.74f, 2.04f, 0.71f }).Within(1e-2));
});
}
19
View Source File : TestFeaturePostProcessing.cs
License : MIT License
Project Creator : ar1st0crat
License : MIT License
Project Creator : ar1st0crat
[Test]
public void TestDeltas()
{
FeaturePostProcessing.AddDeltas(_feats);
replacedert.That(_feats[0], Is.EqualTo(
new float[] { 1, 2, 3, 4, 5, // main features
-.3f, 0, .7f, -.4f, -.5f, // delta
.02f, 0, -.16f, .04f, -.13f }) // delta-delta
.Within(1e-5));
//FeaturePostProcessing.AddDeltas(_feats, includeDeltaDelta: false);
//replacedert.That(_feats[1], Is.EqualTo(
// new float[] { 0, 2, 4, 0, 4,
// -.3f, 0, .5f, -.8f, -.8f }).Within(1e-5));
//replacedert.That(_feats[2], Is.EqualTo(
// new float[] { 0, 2, 6, 4, 3,
// -.2f, 0, 0, 0, -1 }).Within(1e-5));
}
19
View Source File : TestIirFilter.cs
License : MIT License
Project Creator : ar1st0crat
License : MIT License
Project Creator : ar1st0crat
[Test]
public void TestFilterCombinations()
{
var pre = new PreEmphasisFilter();
var de = new DeEmphasisFilter();
var filter = pre * de;
var samples = new[] { 1.0f, 0.1f, -0.4f, 0.2f };
var signal = new DiscreteSignal(1, samples);
var filtered = filter.ApplyTo(signal);
replacedert.That(filtered.Samples, Is.EqualTo(signal.Samples).Within(1e-7));
}
19
View Source File : TestIirFilter.cs
License : MIT License
Project Creator : ar1st0crat
License : MIT License
Project Creator : ar1st0crat
private static void replacedertFilterOutput(DiscreteSignal output)
{
replacedert.Multiple(() =>
{
replacedert.That(output[0], Is.EqualTo(1.0).Within(1e-7));
replacedert.That(output[1], Is.EqualTo(1.0).Within(1e-7));
replacedert.That(output[2], Is.EqualTo(0.4).Within(1e-7));
replacedert.That(output[3], Is.EqualTo(0.04).Within(1e-7));
});
}
19
View Source File : TestTransferFunction.cs
License : MIT License
Project Creator : ar1st0crat
License : MIT License
Project Creator : ar1st0crat
[Test]
public void TestParallelIirFir()
{
var f1 = new IirFilter(new[] { 1, 0.4 }, new[] { 1, -0.6 });
var f2 = new FirFilter(new[] { 1, -0.1 });
var f = f1 + f2;
replacedert.Multiple(() =>
{
replacedert.That(f.Tf.Numerator, Is.EqualTo(new[] { 2, -0.3, 0.06 }).Within(1e-7));
replacedert.That(f.Tf.Denominator, Is.EqualTo(new[] { 1, -0.6 }).Within(1e-7));
replacedert.That(f, Is.TypeOf<IirFilter>());
});
}
See More Examples