public void MissingDestProp() { var primitiveC = new SimpleC(); var primitiveA = _mapper.Map <SimpleObjectA>(primitiveC); Assert.AreEqual(primitiveC.Primitive, primitiveA.Primitive); }
public void WithOutOverrideHashCode() { var mapper = new MapperBuilder() .AddMapper <SimpleC, SimpleD>() .Reverse() .Build(); var a = new SimpleC { Id = _fixture.Create <int>(), Text = _fixture.Create <string>(), IsEnable = _fixture.Create <bool>() }; var b = new SimpleD { Id = _fixture.Create <int>(), Text = _fixture.Create <string>(), IsEnable = _fixture.Create <bool>() }; a.Simple = b; b.Simple = a; var newB = mapper.Map <SimpleD>(a); newB.Id.Should().Be(a.Id); newB.Text.Should().Be(a.Text); newB.IsEnable.Should().Be(a.IsEnable); newB.Simple.Id.Should().Be(b.Id); newB.Simple.Text.Should().Be(b.Text); newB.Simple.IsEnable.Should().Be(b.IsEnable); }
public void MissingDestPropWithValues() { var primitiveC = new SimpleC { Primitive = 32, HereOnly = 12 }; var primitiveA = _mapper.Map <SimpleObjectA>(primitiveC); Assert.AreEqual(primitiveC.Primitive, primitiveA.Primitive); }
public virtual bool NeedTransition(SimpleC target) { return(false); }
public virtual void Excute(SimpleC target) { }