public void Name_spec_should_not_match_if_no_metadata_matches()
        {
            var specification = new MetadataSpecification("test", "node");

            var matches = specification.Matches(new TestDataNode(new TestData("id", 
                "name", "fullName")));

            Assert.IsFalse(matches);
        }
Пример #2
0
        public void Name_spec_should_not_match_if_no_metadata_matches()
        {
            var specification = new MetadataSpecification("test", "node");

            var matches = specification.Matches(new TestDataNode(new TestData("id",
                                                                              "name", "fullName")));

            Assert.IsFalse(matches);
        }
Пример #3
0
        void Verify()
        {
            var properties    = new MemberSpecification <PropertyInfo>(AllowPrivateSetters.Default);
            var specification = new MetadataSpecification(properties, DefaultMetadataSpecification.Field);
            var extensions    = new DefaultExtensions(specification, DeclaredMemberNames.Default, DefaultMemberOrder.Default).ToArray();
            var container     = new ConfigurationContainer(extensions).Create().ForTesting();

            var subject = new PrivateSettablePropertySubject("Hello World!");

            container.Cycle(subject).ShouldBeEquivalentTo(subject);
        }
        public void Name_spec_should_match_on_partial_text()
        {
            const string metadataKey = "test";
            var specification = new MetadataSpecification(metadataKey, "node");
            var testData = new TestData("id", "name", "fullName");
            testData.Metadata.Add(metadataKey, "some node text");

            var matches = specification.Matches(new TestDataNode(testData));

            Assert.IsTrue(matches);
        }
Пример #5
0
        public void Name_spec_should_match_on_partial_text()
        {
            const string metadataKey   = "test";
            var          specification = new MetadataSpecification(metadataKey, "node");
            var          testData      = new TestData("id", "name", "fullName");

            testData.Metadata.Add(metadataKey, "some node text");

            var matches = specification.Matches(new TestDataNode(testData));

            Assert.IsTrue(matches);
        }
Пример #6
0
        void Verify()
        {
            var properties    = new MemberSpecification <PropertyInfo>(AllowPrivateSetters.Default);
            var specification = new MetadataSpecification(properties, DefaultMetadataSpecification.Field);
            var extensions    =
                new DefaultExtensions(specification, DeclaredMemberNames.Default, DefaultMemberOrder.Default).ToArray();
            var support  = new ConfigurationContainer(extensions).ForTesting();
            var instance = new Dto();

            instance.Names.Add("Hello");
            instance.Names.Add("World");
            support.Cycle(instance).Should().BeEquivalentTo(instance);
        }