Ejemplo n.º 1
0
        public void Should_allow_the_removal_and_addition_of_new_value_retrievers()
        {
            var service = new Service();

            foreach (var valueRetriever in service.ValueRetrievers.ToArray())
            {
                service.UnregisterValueRetriever(valueRetriever);
                Assert.IsFalse(service.ValueRetrievers.Contains(valueRetriever));
            }

            var thing = new IExistsForTestingValueRetrieving();

            service.RegisterValueRetriever(thing);
            Assert.AreEqual(1, service.ValueRetrievers.Count());
            Assert.AreSame(thing, service.ValueRetrievers.First());
        }
Ejemplo n.º 2
0
        public void Should_allow_the_removal_and_addition_of_new_value_retrievers()
        {
            var service = new Service();

            foreach (var valueRetriever in service.ValueRetrievers.ToArray())
            {
                service.UnregisterValueRetriever(valueRetriever);
                Assert.DoesNotContain(valueRetriever, service.ValueRetrievers);
            }

            var thing = new IExistsForTestingValueRetrieving();

            service.RegisterValueRetriever(thing);
            Assert.Single(service.ValueRetrievers);
            Assert.Same(thing, service.ValueRetrievers.First());
        }
Ejemplo n.º 3
0
        public void Should_allow_the_removal_and_addition_of_new_value_retrievers()
        {
            var service = new Service();

            foreach (var valueRetriever in service.ValueRetrievers.ToArray())
            {
                service.UnregisterValueRetriever(valueRetriever);
                Assert.IsFalse(service.ValueRetrievers.Contains(valueRetriever));
            }

            var thing = new IExistsForTestingValueRetrieving();
            service.RegisterValueRetriever(thing);
            Assert.AreEqual(1, service.ValueRetrievers.Count());
            Assert.AreSame(thing, service.ValueRetrievers.First());
        }