public void Test_Two_Roles_With_Overloaded_Method_No_Conflict() { var targetType = GetType<Empty>(); var detector = new ConflictDetector(targetType); var result = detector.Process(GetType<Role_With_Method_Take_Int32>(), GetType<Role_With_Method_Take_String>()); OperationAssert.IsSuccessful(result); }
public void Test_Two_Roles_With_Members_With_The_Same_Name_Should_Conflict() { var targetType = GetType<Empty>(); var detector = new ConflictDetector(targetType); var result = detector.Process(GetType<Role_With_Method_Take_String>(), GetType<Role_With_Property_Named_Method>()); OperationAssert.Failed(result); var messages = result.Messages.ToList(); Assert.AreEqual(1, messages.Count); Assert.AreEqual((int)Error.Code.MembersWithSameName, messages[0].Number); }
public void Test_Two_Roles_With_Methods_That_Differ_On_Return_Type_Should_Conflict() { var targetType = GetType<Empty>(); var detector = new ConflictDetector(targetType); var result = detector.Process(GetType<Role_With_Method_Return_Int32>(), GetType<Role_With_Method_Return_String>()); OperationAssert.Failed(result); var messages = result.Messages.ToList(); Assert.AreEqual(1, messages.Count); Assert.AreEqual((int)Error.Code.MethodsWithConflictingSignatures, messages[0].Number); // TODO: add the class' members to the groups // TODO: this message is also valid for when the members differ in accessibility? }
public void Test_Two_Roles_With_Conflicting_Method() { var targetType = GetType<Empty>(); var detector = new ConflictDetector(targetType); var result = detector.Process(GetType<Role_With_Method>(), GetType<Role_With_Method_2>()); OperationAssert.Failed(result); }
public void Test_Two_Roles_No_Conflicts() { var targetType = GetType<Empty>(); var detector = new ConflictDetector(targetType); var result = detector.Process(GetType<Role_With_Method1>(), GetType<Role_With_Method2>()); OperationAssert.IsSuccessful(result); }
public void Test_Superseded_Role_Method_No_Conflict() { var targetType = GetType<Class_With_Method>(); var detector = new ConflictDetector(targetType); var result = detector.Process(GetType<Role_With_Method>()); OperationAssert.IsSuccessful(result); // TODO: check for warning that the method is not marked [Supersede] in the class? // TODO: check that the method in the group is really superseded! }
public void Test_Role_With_Method_In_Empty_Class_No_Conflict() { var targetType = GetType<Empty>(); var detector = new ConflictDetector(targetType); var result = detector.Process(GetType<Role_With_Method>()); OperationAssert.IsSuccessful(result); }
public void Test_No_Roles_No_Conflict() { var targetType = GetType<Empty>(); var detector = new ConflictDetector(targetType); var result = detector.Process(); OperationAssert.IsSuccessful(result); }