Exemplo n.º 1
0
        public void registering_a_simple_class()
        {
            ISimpleServiceContainer container     = new SimpleServiceContainer();
            ProvidedClass           providedClass = new ProvidedClass(5);

            container.Add(providedClass);

            ProvidedClass retrievedObject = container.GetService <ProvidedClass>();

            Assert.That(retrievedObject, Is.Not.Null);
            Assert.That(retrievedObject.Age, Is.EqualTo(5));
        }
Exemplo n.º 2
0
        public void registering_a_simple_class()
        {
            ISimpleServiceContainer container     = new SimpleServiceContainer();
            ProvidedClass           providedClass = new ProvidedClass(5);

            container.Add(providedClass);

            ProvidedClass retrievedObject = container.GetService <ProvidedClass>();

            retrievedObject.Should().NotBeNull();
            retrievedObject.Age.Should().Be(5);
        }