Exemplo n.º 1
0
        public void EqualsObject_NullObject_ReturnsFalse()
        {
            var key1 = new AlignmentKey(10, 20);

            var output = key1.Equals(null);

            Assert.That(output, Is.False);
        }
Exemplo n.º 2
0
 public void AddAlignment(AlignmentKey alignmentKey, RetentionTimeAlignment alignmentValue)
 {
     _alignments = ImmutableSortedList.FromValues(
         _alignments.Concat(new[]
     {
         new KeyValuePair <AlignmentKey, RetentionTimeAlignment>(alignmentKey, alignmentValue)
     }));
 }
 public void AddAlignment(AlignmentKey alignmentKey, RetentionTimeAlignment alignmentValue)
 {
     _alignments = ImmutableSortedList.FromValues(
             _alignments.Concat(new[]
                 {
                     new KeyValuePair<AlignmentKey, RetentionTimeAlignment>(alignmentKey, alignmentValue)
                 }));
 }
Exemplo n.º 4
0
        public void EqualsObject_OfKeysWithSameValues_ReturnsSameValue()
        {
            var key1 = new AlignmentKey(10, 20);
            var key2 = new AlignmentKey(10, 20);

            var output = key1.Equals((object)key2);

            Assert.That(output, Is.True);
        }
Exemplo n.º 5
0
        public void EqualsObject_OfDifferentKeys_ReturnsFalse(int position1, int position2, int position3, int position4)
        {
            var key1 = new AlignmentKey(position1, position2);
            var key2 = new AlignmentKey(position3, position4);

            var output = key1.Equals((object)key2);

            Assert.That(output, Is.False);
        }
Exemplo n.º 6
0
        public void EqualsObject_StringObject_ReturnsFalse()
        {
            var key1 = new AlignmentKey(10, 20);

            // ReSharper disable once SuspiciousTypeConversion.Global
            var output = key1.Equals("string");

            Assert.That(output, Is.False);
        }
 public RetentionTimeAlignment GetAlignment(AlignmentKey alignmentKey)
 {
     RetentionTimeAlignment alignmentValue;
     if (!_alignments.TryGetValue(alignmentKey, out alignmentValue))
     {
         return null;
     }
     return alignmentValue;
 }
Exemplo n.º 8
0
        public RetentionTimeAlignment GetAlignment(AlignmentKey alignmentKey)
        {
            RetentionTimeAlignment alignmentValue;

            if (!_alignments.TryGetValue(alignmentKey, out alignmentValue))
            {
                return(null);
            }
            return(alignmentValue);
        }
Exemplo n.º 9
0
        public void GetHashCode_OfKeysWithSameValues_ReturnsSameValue()
        {
            var key1 = new AlignmentKey(10, 20);
            var key2 = new AlignmentKey(10, 20);

            var hashcode1 = key1.GetHashCode();
            var hashcode2 = key2.GetHashCode();

            Assert.That(hashcode1, Is.EqualTo(hashcode2));
        }
Exemplo n.º 10
0
        public void GetHashCode_OfDifferentKeys_ReturnsDifferentValues(int position1, int position2, int position3, int position4)
        {
            var key1 = new AlignmentKey(position1, position2);
            var key2 = new AlignmentKey(position3, position4);

            var hashcode1 = key1.GetHashCode();
            var hashcode2 = key2.GetHashCode();

            Assert.That(hashcode1, Is.Not.EqualTo(hashcode2));
        }
Exemplo n.º 11
0
        public void Constructor_Position2_RetainedInProperty(int value)
        {
            var key = new AlignmentKey(0, value);

            Assert.That(key.Position2, Is.EqualTo(value));
        }