private bool AssertNotFoundInterfaceInfosEqual(InterfaceDeficitInfo actualDeficitInfo,
                                                InterfaceDeficitInfo expectedDeficitInfo)
 {
     return(actualDeficitInfo.ProblemInterface.SameIdentityAs(expectedDeficitInfo.ProblemInterface) &&
            actualDeficitInfo.Deficit == expectedDeficitInfo.Deficit &&
            UtilsAssert.CollectionsEqual(expectedDeficitInfo.RequiredByComponents,
                                         actualDeficitInfo.RequiredByComponents));
 }
Exemplo n.º 2
0
        private static ValidationFailure CreateNotFoundInterfaceFailure(InterfaceDeficitInfo notFoundInfo)
        {
            var message =
                notFoundInfo.Deficit == 1
                                        ? string.Format("Configuration lacks one \"{0}\" interface, required by {1}",
                                                        notFoundInfo.ProblemInterface.Name,
                                                        ComposeComponentsToString(notFoundInfo.RequiredByComponents))
                                        : string.Format("Configuration lacks {0} \"{1}\" interfaces, required by {2}",
                                                        notFoundInfo.Deficit, notFoundInfo.ProblemInterface.Name,
                                                        ComposeComponentsToString(notFoundInfo.RequiredByComponents));

            return(Failure(message));
        }