Ejemplo n.º 1
0
 /// <summary>Performs a broadcast from the node using the specified amount
 /// of forwarders.</summary>
 public Broadcast(SimpleSource bh, Node forwarder, int forwarders,
                  EventHandler finished) : base(finished)
 {
     BH         = bh;
     Forwarder  = forwarder;
     Forwarders = forwarders;
     Results    = new List <BroadcastReceiver>();
 }
Ejemplo n.º 2
0
        public void SetterViaTargetInterface()
        {
            var mapper = CreateMapperForTarget <SimpleTarget>();

            var source = new SimpleSource();
            var result = mapper.Map(source);

            Assert.That(result.B, Is.EqualTo("A"));
        }
Ejemplo n.º 3
0
        public void SetterViaSourceInterface()
        {
            var mapper = FluentMapper
                         .ThatMaps <SimpleTarget>().From <ISource>()
                         .ThatSets(tgt => tgt.B).From(src => src.A)
                         .Create();

            var source = new SimpleSource();
            var result = mapper.Map(source);

            Assert.That(result.B, Is.EqualTo("A"));
        }
Ejemplo n.º 4
0
        public void CustomMap()
        {
            var mapper = FluentMapper
                         .ThatMaps <SimpleTarget>().From <SimpleSource>()
                         .WithMappingAction((tgt, src) => tgt.SetB(src.A))
                         .IgnoringTargetProperty(tgt => tgt.B)
                         .Create();

            var source = new SimpleSource();
            var result = mapper.Map(source);

            Assert.That(result.B, Is.EqualTo("A"));
        }