コード例 #1
0
        private TestTag CreateTag(Func <TestTag, ITagAttribute> action)
        {
            var tag = new TestTag();

            tag.NumberValue = action(tag);
            return(tag);
        }
コード例 #2
0
ファイル: TestTagTests.cs プロジェクト: Carbonfrost/f-spec
 public void AliasTo_should_obtain_alias_of_macOS()
 {
     Assert.Equal(
         TestTag.macOSPlatform,
         TestTag.Platform("osx").AliasTo
         );
 }
コード例 #3
0
ファイル: TestTagTests.cs プロジェクト: Carbonfrost/f-spec
 public void JsonUtility_ToJson_should_generate_String()
 {
     Assert.Equal(
         "\"platform:windows\"",
         JsonUtility.ToJson(TestTag.Platform("windows"))
         );
 }
コード例 #4
0
ファイル: TestTagTests.cs プロジェクト: Carbonfrost/f-spec
 public void JsonUtility_LoadJson_should_parse_String()
 {
     Assert.Equal(
         TestTag.Platform("windows"),
         JsonUtility.LoadJson <TestTag>("\"platform:windows\"")
         );
 }
コード例 #5
0
 private static TestTagPredicate _TryParseExactly(string text)
 {
     if (TestTag.TryParse(text, out TestTag tag))
     {
         return(Exactly(tag));
     }
     return(null);
 }
コード例 #6
0
        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);
        }
コード例 #7
0
ファイル: TestTagTests.cs プロジェクト: Carbonfrost/f-spec
        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))
                );
        }
コード例 #8
0
ファイル: TestTagTests.cs プロジェクト: Carbonfrost/f-spec
        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"))
                );
        }
コード例 #9
0
ファイル: TagTest.cs プロジェクト: tbossi/Tags
        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>");
        }
コード例 #10
0
ファイル: TestTagTests.cs プロジェクト: Carbonfrost/f-spec
 public void Parse_should_extract_Value_from_string(string text)
 {
     Assert.Equal("value", TestTag.Parse(text).Value);
 }
コード例 #11
0
ファイル: TestTagTests.cs プロジェクト: Carbonfrost/f-spec
 public void Parse_should_extract_Type_from_string(string text)
 {
     Assert.Equal("name", TestTag.Parse(text).Type);
 }
コード例 #12
0
 public TestTagViewModel(string text, TestTag tag, TestTagViewModelCollection testTagViewModelCollection)
 {
     this.Text = text;
     this.Tag  = tag;
     this.Tags = testTagViewModelCollection;
 }
コード例 #13
0
 public TestTagViewModel(string text, TestTag tag)
 {
     this.Text = text;
     this.Tag  = tag;
 }
コード例 #14
0
 public static TestTagPredicate Previously(string tag)
 {
     return(Exactly(TestTag.Previously(tag)));
 }
コード例 #15
0
ファイル: TestTagTests.cs プロジェクト: Carbonfrost/f-spec
 public void IsAlias_should_apply_to_osx_platform()
 {
     Assert.True(
         TestTag.Platform("osx").IsAlias
         );
 }
コード例 #16
0
 public void Contains_test_tag_match()
 {
     Assert.Contains(TestTag.Parse("hello:world"), new TestTagCollection {
         { "hello:world" }
     });
 }
コード例 #17
0
ファイル: TagTest.cs プロジェクト: tbossi/Tags
 public void SetUp()
 {
     _tag = new TestTag();
 }
コード例 #18
0
 public ExactlyImpl(TestTag tag)
 {
     _tag = tag;
 }
コード例 #19
0
 public static TestTagPredicate Exactly(TestTag tag)
 {
     return(new ExactlyImpl(tag));
 }
コード例 #20
0
 public static TestTagPredicate Previously(TestStatus value)
 {
     return(Exactly(TestTag.Previously(value)));
 }
コード例 #21
0
 private TestTag CreateTag(Func<TestTag, ITagAttribute> action)
 {
     var tag = new TestTag();
     tag.NumberValue = action(tag);
     return tag;
 }
コード例 #22
0
ファイル: AttributeTest.cs プロジェクト: tbossi/Tags
 public virtual void SetUp()
 {
     Tag      = new Mock <T>();
     _testTag = new TestTag("test");
 }