Beispiel #1
0
        public void IsSameOrSubtypeOfAny_WhenOtherTypesIsNull_Throws()
        {
            var type = new FileType("id", "description", null);

            Assert.Throws<ArgumentNullException>(() => type.IsSameOrSubtypeOfAny(null));
        }
Beispiel #2
0
        public void IsSameOrSubtypeOfAny_WhenOtherTypesContainsUnrelatedAndSame_ReturnsTrue()
        {
            var superType = new FileType("superId", "superDescription", null);
            var type = new FileType("id", "description", superType);
            var unrelatedType = new FileType("otherId", "otherDescription", superType);

            Assert.IsTrue(type.IsSameOrSubtypeOfAny(unrelatedType, type));
        }
Beispiel #3
0
        public void IsSameOrSubtypeOfAny_WhenOtherTypesIsEmpty_ReturnsFalse()
        {
            var type = new FileType("id", "description", null);

            Assert.IsFalse(type.IsSameOrSubtypeOfAny());
        }
Beispiel #4
0
        public void IsSameOrSubtypeOfAny_WhenOtherTypesIsUnrelated_ReturnsFalse()
        {
            var superType = new FileType("superId", "superDescription", null);
            var type = new FileType("id", "description", superType);
            var unrelatedType = new FileType("otherId", "otherDescription", superType);

            Assert.IsFalse(type.IsSameOrSubtypeOfAny(unrelatedType));
        }
Beispiel #5
0
        public void IsSameOrSubtypeOfAny_WhenOtherTypesContainsSame_ReturnsTrue()
        {
            var type = new FileType("id", "description", null);

            Assert.IsTrue(type.IsSameOrSubtypeOfAny(type));
        }