コード例 #1
0
        public void Map_with_default_success()
        {
            var task = new BaseTask <TestItem>();

            task.Map(x => x.ItemId, null, null, 1);
            var map = task.Maps.First();

            Assert.That(map.Default, Is.EqualTo(1));
        }
コード例 #2
0
        public void Map_with_alias_success()
        {
            var task = new BaseTask <TestItem>();

            task.Map(x => x.ItemId, "id");
            var map = task.Maps.First();

            Assert.That(map.Alias, Is.EqualTo("id"));
        }
コード例 #3
0
        public void Map_with_func_success()
        {
            var task = new BaseTask <TestItem>();

            task.Map(x => x.ItemId, null, x => x.Length);
            var map = task.Maps.First();

            Assert.That(map.Converter, Is.Not.Null);
            Assert.That(map.Setter, Is.Not.Null);
        }
コード例 #4
0
        public void Map_success()
        {
            var task = new BaseTask <TestItem>();

            task.Map(x => x.ItemId);
            var map = task.Maps.First();

            Assert.That(task.Maps.Count, Is.EqualTo(1));
            Assert.That(map.Alias, Is.EqualTo("itemid"));
            Assert.That(map.Setter, Is.Not.Null);
        }