public void SetsValuesCorrectly() { var typeRequestInfo = new TypeRequestInfo(typeof(int), "mytag"); Assert.AreEqual(typeof(int), typeRequestInfo.Type); Assert.AreEqual("mytag", typeRequestInfo.Tag); }
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)); }
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); }
public void ThrowsArgumentNullExceptionForNullParent() { var item = new TypeRequestInfo(typeof(X)); ExceptionTester.CallMethodAndExpectException <ArgumentException>(() => TypeRequestPath.Branch(null, item)); }
public void ThrowsArgumentNullExceptionForNullTypePath() { TypeRequestInfo requestInfo = new TypeRequestInfo(typeof(object)); ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => new CircularDependencyException(requestInfo, null, string.Empty)); }