public static void GetValue_GivenNullVersion_ThrowsArgmentNullException()
        {
            var dictionary = new Dictionary <Version, int>
            {
                [new Version(1, 0)] = 1,
                [new Version(1, 1)] = 2
            };
            var versionDictionary = new VersionResolvingDictionary <int>(dictionary);

            Assert.That(() => versionDictionary.GetValue(null), Throws.ArgumentNullException);
        }
        public static void GetValue_GivenVersionMoreThanHighestInCtor_ReturnsHighestInCtor()
        {
            var dictionary = new Dictionary <Version, int>
            {
                [new Version(1, 0)] = 1,
                [new Version(1, 1)] = 2
            };
            var versionDictionary = new VersionResolvingDictionary <int>(dictionary);

            var value = versionDictionary.GetValue(new Version(2, 0));

            Assert.That(value, Is.EqualTo(2));
        }
        public static void GetValue_GivenVersionAboveMiddle_ReturnsValueFromMiddleVersion()
        {
            var dictionary = new Dictionary <Version, int>
            {
                [new Version(1, 0)] = 1,
                [new Version(1, 1)] = 2,
                [new Version(2, 0)] = 3
            };
            var versionDictionary = new VersionResolvingDictionary <int>(dictionary);

            var value = versionDictionary.GetValue(new Version(1, 5));

            Assert.That(value, Is.EqualTo(2));
        }