public void Invariant_GetHashCode_should_match_by_value() { Given(TestTagPredicate.Anything).Expect(t => t.GetHashCode()) .ToBe.EqualTo(TestTagPredicate.Invariant(true).GetHashCode()); Given(TestTagPredicate.Nothing).Expect(t => t.GetHashCode()) .ToBe.EqualTo(TestTagPredicate.Invariant(false).GetHashCode()); }
public void JsonUtility_ToJson_should_generate_String() { Assert.Equal( "\"platform:windows\"", JsonUtility.ToJson(TestTagPredicate.Platform("windows")) ); }
public void JsonUtility_LoadJson_should_parse_String() { Assert.Equal( TestTagPredicate.Platform("windows"), JsonUtility.LoadJson <TestTagPredicate>("\"platform:windows\"") ); }
public void And_Equals_should_match_by_value() { var and1 = TestTagPredicate.And( TestTagPredicate.Platform("a"), TestTagPredicate.Platform("b"), TestTagPredicate.Platform("c") ); var and2 = TestTagPredicate.And( TestTagPredicate.Platform("a"), TestTagPredicate.Platform("b"), TestTagPredicate.Platform("c") ); Assert.True(and1.Equals(and2)); }
public void Invariant_Equals_should_match_by_value() { Assert.True(TestTagPredicate.Anything == TestTagPredicate.Parse("*")); Assert.True(TestTagPredicate.Nothing == TestTagPredicate.Parse("~")); }
public void Parse_will_generate_Nothing() { Assert.Equal(TestTagPredicate.Nothing, TestTagPredicate.Parse("~")); }
public void Parse_will_generate_Anything() { Assert.Equal(TestTagPredicate.Anything, TestTagPredicate.Parse("*")); }
public void Parse_will_generate_roundtrip_string(string text) { var pp = TestTagPredicate.Parse(text); Assert.Equal(text, pp.ToString()); }
public void Parse_will_generate_negated_tag() { var pp = TestTagPredicate.Parse("~ego"); Assert.IsInstanceOf <TestTagPredicate.NegatedImpl>(pp); }