コード例 #1
0
 public iNaturalistMapperFactory()
 {
     CommentMapper = new CommentMapper();
     PhotoMapper = new PhotoMapper();
     TaxonMapper = new TaxonMapper(PhotoMapper);
     IdentificationMapper = new IdentificationMapper(TaxonMapper);
     UserMapper = new UserMapper();
     ObservationMapper = new ObservationMapper(CommentMapper, IdentificationMapper,
         PhotoMapper, TaxonMapper, UserMapper);
 }
コード例 #2
0
        public void IdentificationMapTest()
        {
            // Arrange
            var mockTaxonMapper = new Mock<IMapper<Taxon>>().Object;
            var identificationMapper = new IdentificationMapper(mockTaxonMapper);

            dynamic obj = new JObject();
            obj.id = "101";
            obj.created_at = "2013-11-20T14:28:53.572+11:00";
            obj.body = "Hello!";

            var identification = new Identification();

            // Act
            identificationMapper.Map(obj, identification);

            // Assert
            Assert.AreEqual(identification.Id, 101);
            Assert.AreEqual(identification.CreatedAt, Convert.ToDateTime("2013-11-20T14:28:53.572+11:00"));
            Assert.AreEqual(identification.Body, "Hello!");
            Assert.AreEqual(identification.Taxon, null);
        }
コード例 #3
0
 public override async Task <BLL.App.DTO.Identification> FindAsync(params object[] id)
 {
     return(IdentificationMapper.MapFromDAL(await Uow.Identifications.FindAsync(id)));
 }