Exemplo n.º 1
0
        public void It_can_create_objects_of_each_supported_type()
        {
            var sut = new ArmorSkinDiscriminatorOptions();

            var actual = sut.GetDiscriminatedTypes().Select(x => x.Type).ToList();

            Assert.All(actual, type => Assert.IsType(type, sut.Create(type)));
        }
Exemplo n.º 2
0
        public void It_only_creates_objects_that_extend_the_correct_base_type()
        {
            var sut = new ArmorSkinDiscriminatorOptions();

            var actual = sut.GetDiscriminatedTypes().Select(x => x.Type).ToList();

            Assert.All(actual, type => Assert.IsAssignableFrom(sut.BaseType, sut.Create(type)));
        }
Exemplo n.º 3
0
        public void It_supports_every_known_type_name()
        {
            var sut = new ArmorSkinDiscriminatorOptions();

            var expected = _fixture.Db.GetArmorTypeNames().ToHashSet();

            var actual = sut.GetDiscriminatedTypes().Select(x => x.TypeName).ToHashSet();

            Assert.Equal(expected, actual);
        }