예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #6
0
        public void Set_WhenFromIsNull_FromBecomesNewId()
        {
            var from     = StructureId.Create(1);
            var interval = new StructureIdInterval();

            interval.Set(from);

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