Ejemplo n.º 1
0
        public void ShouldThrowArgumentExceptionWhenNoService()
        {
            var dep = new Hdependency();

            // no such service
            Expect <Action>(() => dep.Get <IEnumerable>()).ToThrowException <ArgumentException>();
        }
Ejemplo n.º 2
0
        public void ShouldGetTheRightService()
        {
            var         dep     = new Hdependency();
            IEnumerable service = "test"; //a string is a valid IEnumerable, so this is possible

            dep.Register <IEnumerable>(service);
            Expect(dep.Get <IEnumerable>()).ToBe("test");
        }