コード例 #1
0
        public void WhenForceClassRelationToIncompatibleTypeThenThrows()
        {
            var hbm = new HbmOneToMany();
            var mapper = new OneToManyMapper(typeof(IMyInterface), hbm, null);

            Executing.This(() => mapper.Class(typeof(Whatever))).Should().Throw<ArgumentOutOfRangeException>();
        }
コード例 #2
0
 public void CanAssignNotFoundMode()
 {
     var hbm = new HbmOneToMany();
     var mapper = new OneToManyMapper(typeof(MyClass), hbm, null);
     mapper.NotFound(NotFoundMode.Ignore);
     hbm.NotFoundMode.Should().Be(HbmNotFoundMode.Ignore);
 }
コード例 #3
0
 public void CanAssignEntityName()
 {
     var hbm = new HbmOneToMany();
     var mapper = new OneToManyMapper(typeof(MyClass), hbm, null);
     mapper.EntityName("myname");
     hbm.EntityName.Should().Be("myname");
 }
コード例 #4
0
        public void CanForceClassRelation()
        {
            var hbm = new HbmOneToMany();
            var mapper = new OneToManyMapper(typeof(IMyInterface), hbm, null);

            mapper.Class(typeof(MyClass));

            hbm.Class.Should().Contain("MyClass").And.Not.Contain("IMyInterface");
        }