private TestTag CreateTag(Func <TestTag, ITagAttribute> action) { var tag = new TestTag(); tag.NumberValue = action(tag); return(tag); }
public void AliasTo_should_obtain_alias_of_macOS() { Assert.Equal( TestTag.macOSPlatform, TestTag.Platform("osx").AliasTo ); }
public void JsonUtility_ToJson_should_generate_String() { Assert.Equal( "\"platform:windows\"", JsonUtility.ToJson(TestTag.Platform("windows")) ); }
public void JsonUtility_LoadJson_should_parse_String() { Assert.Equal( TestTag.Platform("windows"), JsonUtility.LoadJson <TestTag>("\"platform:windows\"") ); }
private static TestTagPredicate _TryParseExactly(string text) { if (TestTag.TryParse(text, out TestTag tag)) { return(Exactly(tag)); } return(null); }
public void GetData_will_get_TestData_with_correct_tags() { var data = GetData(() => new FixtureDataAttribute("data:hello:world") { Tag = "platform:windows", Tags = new [] { "slow" } }); Assert.Equal(new [] { TestTag.Parse("platform:windows"), TestTag.Slow }, data[0].Tags); }
public void Parse_should_throw_on_invalid_text(string text) { var ex = Record.Exception(() => TestTag.Parse(text)); Expect(ex).Not.ToBe.Null(); Expect(ex).ToSatisfy.Any( Matchers.BeInstanceOf(typeof(FormatException)), Matchers.BeInstanceOf(typeof(ArgumentException)) ); }
public void AreEquivalent_is_symmetric_and_applies_to_macos() { Assert.True( TestTag.AreEquivalent(TestTag.Platform("osx"), TestTag.macOSPlatform) ); Assert.True( TestTag.AreEquivalent(TestTag.macOSPlatform, TestTag.Platform("osx")) ); }
public void Render() { RenderAssertion(new TestTag("tagname"), "<tagname></tagname>"); RenderAssertion(new TestTag("tagname", TagRenderMode.SelfClosing), "<tagname>"); var tag = new TestTag("tagname"); tag.AddAttribute("attr1"); tag.AddAttribute("attr2", "value of attr"); RenderAssertion(tag, "<tagname attr1 attr2=\"value of attr\"></tagname>"); tag = new TestTag("tagname"); tag.AddAttribute("attr1"); tag.AddInnerHtml(new TestTag("innerTag", TagRenderMode.SelfClosing)); RenderAssertion(tag, "<tagname attr1><innerTag></tagname>"); }
public void Parse_should_extract_Value_from_string(string text) { Assert.Equal("value", TestTag.Parse(text).Value); }
public void Parse_should_extract_Type_from_string(string text) { Assert.Equal("name", TestTag.Parse(text).Type); }
public TestTagViewModel(string text, TestTag tag, TestTagViewModelCollection testTagViewModelCollection) { this.Text = text; this.Tag = tag; this.Tags = testTagViewModelCollection; }
public TestTagViewModel(string text, TestTag tag) { this.Text = text; this.Tag = tag; }
public static TestTagPredicate Previously(string tag) { return(Exactly(TestTag.Previously(tag))); }
public void IsAlias_should_apply_to_osx_platform() { Assert.True( TestTag.Platform("osx").IsAlias ); }
public void Contains_test_tag_match() { Assert.Contains(TestTag.Parse("hello:world"), new TestTagCollection { { "hello:world" } }); }
public void SetUp() { _tag = new TestTag(); }
public ExactlyImpl(TestTag tag) { _tag = tag; }
public static TestTagPredicate Exactly(TestTag tag) { return(new ExactlyImpl(tag)); }
public static TestTagPredicate Previously(TestStatus value) { return(Exactly(TestTag.Previously(value))); }
private TestTag CreateTag(Func<TestTag, ITagAttribute> action) { var tag = new TestTag(); tag.NumberValue = action(tag); return tag; }
public virtual void SetUp() { Tag = new Mock <T>(); _testTag = new TestTag("test"); }