public void MapBOToModelList() { var mapper = new BOLApiKeyMapper(); BOApiKey bo = new BOApiKey(); bo.SetProperties("A", "A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A"); List <ApiApiKeyResponseModel> response = mapper.MapBOToModel(new List <BOApiKey>() { { bo } }); response.Count.Should().Be(1); }
public void MapModelToBO() { var mapper = new BOLApiKeyMapper(); ApiApiKeyRequestModel model = new ApiApiKeyRequestModel(); model.SetProperties("A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A"); BOApiKey response = mapper.MapModelToBO("A", model); response.ApiKeyHashed.Should().Be("A"); response.Created.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM")); response.JSON.Should().Be("A"); response.UserId.Should().Be("A"); }
public void MapBOToModel() { var mapper = new BOLApiKeyMapper(); BOApiKey bo = new BOApiKey(); bo.SetProperties("A", "A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A"); ApiApiKeyResponseModel response = mapper.MapBOToModel(bo); response.ApiKeyHashed.Should().Be("A"); response.Created.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM")); response.Id.Should().Be("A"); response.JSON.Should().Be("A"); response.UserId.Should().Be("A"); }
public void MapEFToBO() { var mapper = new DALApiKeyMapper(); ApiKey entity = new ApiKey(); entity.SetProperties("A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A"); BOApiKey response = mapper.MapEFToBO(entity); response.ApiKeyHashed.Should().Be("A"); response.Created.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM")); response.Id.Should().Be("A"); response.JSON.Should().Be("A"); response.UserId.Should().Be("A"); }