Example #1
0
        public void GivenNullInstance_ReturnPropertyName()
        {
            var transfer = new IdentityMapNameTransfer(new Dictionary <PropertyIdentity, string>());
            var val      = transfer.Transfer(null, "a");

            Assert.AreEqual("a", val);
        }
Example #2
0
        public void GivenNullArgsCall_MustThrowException()
        {
            var transfer = new IdentityMapNameTransfer(new Dictionary <PropertyIdentity, string>());

            Assert.ThrowsException <ArgumentException>(() => transfer.Transfer(new object(), null));
            Assert.ThrowsException <ArgumentNullException>(() => new IdentityMapNameTransfer(null));
        }
Example #3
0
        public void GivenBasePath_TransterIt_ReturnMustCombinedBasePath()
        {
            var basePath = "BasePath";
            var map      = new Dictionary <PropertyIdentity, string>
            {
                [new PropertyIdentity(typeof(ABox), "A")] = "B"
            };
            var transfer = new IdentityMapNameTransfer(basePath, map);

            Assert.AreEqual(basePath, transfer.BasePath);
            var n = transfer.Transfer(new ABox(), "A");

            Assert.AreEqual("B", n);
        }