public void Hashes_should_not_be_equal()
        {
            var hash1 = ConversionPattern.Parse("%l %m").GetHashCode();
            var hash2 = ConversionPattern.Parse("%l %e").GetHashCode();

            hash1.Should().NotBe(hash2);
        }
        public void Hashes_should_not_be_equal_by_formats()
        {
            var hash1 = ConversionPattern.Parse("%l %p(prop:f2)").GetHashCode();
            var hash2 = ConversionPattern.Parse("%l %p(prop:f3)").GetHashCode();

            hash1.Should().NotBe(hash2);
        }
        public void Hashes_should_be_equal()
        {
            var hash1 = ConversionPattern.Parse("%l %m").GetHashCode();
            var hash2 = ConversionPattern.Create().AddLevel().AddText(" ").AddMessage().Build().GetHashCode();

            hash1.Should().Be(hash2);
        }
        public void Should_not_be_equal_by_values()
        {
            var pattern1 = ConversionPattern.Parse("%l %m");
            var pattern2 = ConversionPattern.Parse("%l %e");

            pattern1.Equals(pattern2).Should().BeFalse();
            pattern2.Equals(pattern1).Should().BeFalse();
        }
        public void Should_be_equal_by_values()
        {
            var pattern1 = ConversionPattern.Parse("%l %m");
            var pattern2 = ConversionPattern.Create().AddLevel().AddText(" ").AddMessage().Build();

            pattern1.Equals(pattern2).Should().BeTrue();
            pattern2.Equals(pattern1).Should().BeTrue();
        }
 public void AddText_should_add_TextFragment()
 {
     ConversionPattern.Create().AddText("text").Build()
     .Should().Be(ConversionPattern.Parse("text"));
 }
 public void AddProperty_should_add_PropertyFragment()
 {
     ConversionPattern.Create().AddProperty("name").Build()
     .Should().Be(ConversionPattern.Parse("%p(name)"));
 }
 public void AddProperty_should_add_PropertyFragment_with_format()
 {
     ConversionPattern.Create().AddProperty("name", "format").Build()
     .Should().Be(ConversionPattern.Parse("%p(name:format)"));
 }
 public void AddNewLine_should_add_NewLineFragment()
 {
     ConversionPattern.Create().AddNewLine().Build()
     .Should().Be(ConversionPattern.Parse("%n"));
 }
 public void AddProperties_should_add_PropertiesFragment()
 {
     ConversionPattern.Create().AddProperties().Build()
     .Should().Be(ConversionPattern.Parse("%p"));
 }
 public void AddMessage_should_add_MessageFragment()
 {
     ConversionPattern.Create().AddMessage().Build()
     .Should().Be(ConversionPattern.Parse("%m"));
 }
 public void AddLevel_should_add_LevelFragment()
 {
     ConversionPattern.Create().AddLevel().Build()
     .Should().Be(ConversionPattern.Parse("%l"));
 }
 public void AddException_should_add_ExceptionFragment()
 {
     ConversionPattern.Create().AddException().Build()
     .Should().Be(ConversionPattern.Parse("%e"));
 }
 public void AddDateTime_should_add_DateTimeFragment_with_format()
 {
     ConversionPattern.Create().AddDateTime("yyyy").Build()
     .Should().Be(ConversionPattern.Parse("%d(yyyy)"));
 }
 public void AddDateTime_should_add_DateTimeFragment()
 {
     ConversionPattern.Create().AddDateTime().Build()
     .Should().Be(ConversionPattern.Parse("%d"));
 }