Created
April 3, 2018 13:11
-
-
Save Alexei000/5fd6154fcaac37247dd0ac781df5c8ed to your computer and use it in GitHub Desktop.
Environment proxy service mock class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EnvironmentProxyServiceMock : IEnvironmentProxyService | |
{ | |
public List<EnvironmentServiceModel> Environments => EnvironmentInitialData.EnvironmentServiceModels; | |
public Dictionary<int, EnvironmentServiceModel> EnvironmentsMap => Environments.ToDictionary(item => item.EnvironmentId, item => item); | |
public EnvironmentServiceModel Get(int environmentId) => EnvironmentsMap.ContainsKey(environmentId) ? EnvironmentsMap[environmentId] : null; | |
public List<EnvironmentTypeApiModel> EnvironmentTypes => EnvironmentInitialData.EnvironmentTypeModels; | |
public Dictionary<int, EnvironmentTypeApiModel> EnvironmentTypesMap => EnvironmentTypes.ToDictionary(et => et.EnvironmentTypeId, et => et); | |
public EnvironmentTypeApiModel GetType(int environmentTypeId) => EnvironmentTypesMap.ContainsKey(environmentTypeId) | |
? EnvironmentTypesMap[environmentTypeId] | |
: null; | |
// some methods omitted for brevity | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment