コード例 #1
0
        public void MapModelToEntity()
        {
            var mapper = new DALUnitMapper();
            ApiUnitServerRequestModel model = new ApiUnitServerRequestModel();

            model.SetProperties("A");
            Unit response = mapper.MapModelToEntity(1, model);

            response.CallSign.Should().Be("A");
        }
コード例 #2
0
        public void MapEntityToModel()
        {
            var  mapper = new DALUnitMapper();
            Unit item   = new Unit();

            item.SetProperties(1, "A");
            ApiUnitServerResponseModel response = mapper.MapEntityToModel(item);

            response.CallSign.Should().Be("A");
            response.Id.Should().Be(1);
        }
コード例 #3
0
        public void MapEntityToModelList()
        {
            var  mapper = new DALUnitMapper();
            Unit item   = new Unit();

            item.SetProperties(1, "A");
            List <ApiUnitServerResponseModel> response = mapper.MapEntityToModel(new List <Unit>()
            {
                { item }
            });

            response.Count.Should().Be(1);
        }