Пример #1
0
        public void VersionHasStringSuffix(string version, bool hasSuffix)
        {
            var parsedVersion = Version.Parse(version);

            if (hasSuffix)
            {
                parsedVersion.VersionTokens.Last().Should().BeOfType <VersionStringToken>();
            }
            else
            {
                parsedVersion.VersionTokens.Last().Should().BeOfType <VersionNumberToken>();
            }
        }
Пример #2
0
        public void ParseVersionTest(string version, bool shouldNotThrow)
        {
            var action = new Action(() => Version.Parse(version));

            if (shouldNotThrow is false)
            {
                action.Should().Throw <InvalidOperationException>();
            }
            else
            {
                action.Should().NotThrow <InvalidOperationException>();
            }
        }
Пример #3
0
        public void VersionTokensHasPrefix(string version, bool hasPrefix)
        {
            var parsedVersion = Version.Parse(version);

            parsedVersion.HasPrefix.Should().Be(hasPrefix);
        }
Пример #4
0
        public void VersionToString(string version, string expectedString)
        {
            var parsedVersion = Version.Parse(version);

            parsedVersion.ToString().Should().Be(expectedString);
        }