예제 #1
0
        public void TestFindRecommendedRequireVersion(string versionPretty, bool isDev, Stabilities stability, string expectedVersion)
        {
            var versionParser = new BVersionParser();

            var package = new Mock <IPackage>();

            package.Setup((o) => o.GetVersionPretty()).Returns(versionPretty);
            package.Setup((o) => o.GetVersion()).Returns(versionParser.Normalize(versionPretty));
            package.Setup((o) => o.IsDev).Returns(isDev);
            package.Setup((o) => o.GetStability()).Returns(stability);

            var recommended = selector.FindRecommendedRequireVersion(package.Object);

            Assert.AreEqual(expectedVersion, recommended);
        }
예제 #2
0
        private IPackage CreatePackage(string version)
        {
            var parser = new BVersionParser();

            return(new BPackage("foo", parser.Normalize(version), version));
        }