void CreateResolver(VersionMatchingStrategies in1, VersionMatchingStrategies in2) { var creator = Factory.Instance.NugetResolver(); INugetResolver obj = default; Test.IfNot.Action.ThrowsException(() => creator.Create(out obj, in1, in2), out Exception _); Test.IfNot.Object.IsNull(obj); Test.If.Value.IsEqual(obj.AssemblyMatchingStrategy, in1); Test.If.Value.IsEqual(obj.PackageMatchingStrategy, in2); Test.If.Enumerable.Matches(obj.NugetCaches.Select(_ => _.FullName), NugetResolver.GetCaches().Select(_ => _.FullName)); }
void TryCreateResolverWithExOut(VersionMatchingStrategies in1, VersionMatchingStrategies in2) { var creator = Factory.Instance.NugetResolver(); Boolean result = default; INugetResolver obj = default; Exception ex = default; Test.IfNot.Action.ThrowsException(() => result = creator.TryCreate(out obj, in1, in2, out ex), out Exception _); Test.If.Value.IsTrue(result); Test.If.Object.IsNull(ex); Test.IfNot.Object.IsNull(obj); Test.If.Value.IsEqual(obj.AssemblyMatchingStrategy, in1); Test.If.Value.IsEqual(obj.PackageMatchingStrategy, in2); Test.If.Enumerable.Matches(obj.NugetCaches.Select(_ => _.FullName), NugetResolver.GetCaches().Select(_ => _.FullName)); }