Exemplo n.º 1
0
            public void SetsValuesCorrectly()
            {
                var typeRequestInfo = new TypeRequestInfo(typeof(int), "mytag");

                Assert.AreEqual(typeof(int), typeRequestInfo.Type);
                Assert.AreEqual("mytag", typeRequestInfo.Tag);
            }
Exemplo n.º 2
0
            public void FunctionsCorrectlyForDifferentTags()
            {
                var obj1 = new TypeRequestInfo(typeof(int), "mytag1");
                var obj2 = new TypeRequestInfo(typeof(int), "mytag2");

                Assert.IsFalse(obj1 == obj2);
                Assert.IsFalse(obj2 == obj1);

                Assert.IsTrue(obj1 != obj2);
                Assert.IsTrue(obj2 != obj1);

                Assert.IsFalse(obj1.Equals(obj2));
                Assert.IsFalse(obj2.Equals(obj1));
            }
Exemplo n.º 3
0
            public void DoesNotIgnoreValueTypesIfIgnoreValueTypesIsFalse()
            {
                var firstType = new TypeRequestInfo(typeof(X));
                var path      = new TypeRequestPath(firstType, false);

                path.PushType(new TypeRequestInfo(typeof(DateTime)), false);
                Assert.AreEqual(typeof(DateTime), path.LastType.Type);

                path.PushType(new TypeRequestInfo(typeof(double)), false);
                Assert.AreEqual(typeof(double), path.LastType.Type);

                path.PushType(new TypeRequestInfo(typeof(int)), false);
                Assert.AreEqual(typeof(int), path.LastType.Type);
            }
Exemplo n.º 4
0
            public void ThrowsArgumentNullExceptionForNullParent()
            {
                var item = new TypeRequestInfo(typeof(X));

                ExceptionTester.CallMethodAndExpectException <ArgumentException>(() => TypeRequestPath.Branch(null, item));
            }
Exemplo n.º 5
0
            public void ThrowsArgumentNullExceptionForNullTypePath()
            {
                TypeRequestInfo requestInfo = new TypeRequestInfo(typeof(object));

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => new CircularDependencyException(requestInfo, null, string.Empty));
            }