Example #1
0
        public void Clear_WhenFromAndToHasValue_IsCompleteReturnsFalse()
        {
            var interval = new StructureIdInterval();

            interval.Set(StructureId.Create(1));
            interval.Set(StructureId.Create(2));

            interval.Clear();

            Assert.IsFalse(interval.IsComplete);
        }
Example #2
0
        public void Set_WhenFromIsNotNullButToIs_ToGainsNewId()
        {
            var from     = StructureId.Create(1);
            var to       = StructureId.Create(2);
            var interval = new StructureIdInterval();

            interval.Set(from);

            interval.Set(to);

            Assert.AreEqual(to, interval.To);
        }
Example #3
0
        public void Set_WhenFromIsNotNullButToIs_FromRemainsUnchanged()
        {
            var from     = StructureId.Create(1);
            var to       = StructureId.Create(2);
            var interval = new StructureIdInterval();

            interval.Set(from);

            interval.Set(to);

            Assert.AreEqual(from, interval.From);
        }
Example #4
0
        public void Clear_WhenFromAndToHasValue_BothBecomesNull()
        {
            var interval = new StructureIdInterval();

            interval.Set(StructureId.Create(1));
            interval.Set(StructureId.Create(2));

            interval.Clear();

            Assert.IsNull(interval.From);
            Assert.IsNull(interval.To);
        }
Example #5
0
        public void Set_WhenFromAndToHasValue_ToGainsNewId()
        {
            var from     = StructureId.Create(1);
            var to       = StructureId.Create(2);
            var newTo    = StructureId.Create(3);
            var interval = new StructureIdInterval();

            interval.Set(from);
            interval.Set(to);

            interval.Set(newTo);

            Assert.AreEqual(newTo, interval.To);
        }
Example #6
0
        public void Set_WhenFromIsNull_FromBecomesNewId()
        {
            var from     = StructureId.Create(1);
            var interval = new StructureIdInterval();

            interval.Set(from);

            Assert.AreEqual(from, interval.From);
        }