Ejemplo n.º 1
0
        public void Add_GoodValues_Succeeds()
        {
            //Arrange
            var typeMapCollection = new TypeMapCollection();
            var typeMap = new TypeMap(typeof(Type), typeof(Type));

            //Act
            typeMapCollection.Add(typeMap);

            //Assert
            Assert.AreEqual<TypeMapBase>(typeMap, typeMapCollection.Get(typeof(Type), typeof(Type)));
        }
Ejemplo n.º 2
0
        public void Clear_Always_Succeeds()
        {
            //Arrange
            var typeMapCollection = new TypeMapCollection();

            typeMapCollection.Add(new TypeMap(typeof(Type), typeof(Type)));

            //Act
            typeMapCollection.Clear();

            //Assert
            Assert.IsNull(typeMapCollection.Get(typeof(Type), typeof(Type)));
        }
Ejemplo n.º 3
0
        public void Get_GoodValues_ReturnsTypeMap()
        {
            //Arrange
            var typeMapCollection = new TypeMapCollection();
            var typeMap = new TypeMap(typeof(Type), typeof(Type));
            typeMapCollection.Add(typeMap);

            //Act
            var actual = typeMapCollection.Get(typeof(Type), typeof(Type));
            var value = typeMapCollection.Get(typeof(Type), typeof(string));

            //Assert
            Assert.AreEqual<TypeMapBase>(typeMap, actual);
            Assert.IsNull(value);
        }
Ejemplo n.º 4
0
        public void Remove_GoodValues_Succeeds()
        {
            //arrange
            var typeMapCollection = new TypeMapCollection();

            typeMapCollection.Add(new TypeMap(typeof(Type), typeof(Type)));

            //Act
            typeMapCollection.Remove(typeof(Type), typeof(Type));
            typeMapCollection.Remove(typeof(Type), typeof(string));
            typeMapCollection.Remove(typeof(string), typeof(string));

            //Assert
            Assert.IsNull(typeMapCollection.Get(typeof(Type), typeof(Type)));
            Assert.IsNull(typeMapCollection.Get(typeof(Type), typeof(string)));
            Assert.IsNull(typeMapCollection.Get(typeof(string), typeof(string)));
        }