private IResourceDefinition BuildResource(ResourceTestData data) { var mockResource = new Mock <IResourceDefinition>(); mockResource.Setup(resource => resource.Type).Returns(data.Type); return(mockResource.Object); }
private IResourceDefinition BuildResourceDefinition( ResourceTestData data, List <IImprovementTemplate> availableTemplates ) { var mockResource = new Mock <IResourceDefinition>(); mockResource.Setup(resource => resource.Type).Returns(data.Type); mockResource.Setup(resource => resource.Extractor).Returns( data.ExtractorIndex >= 0 ? availableTemplates[data.ExtractorIndex] : null ); var newResource = mockResource.Object; MockTechCanon.Setup(canon => canon.IsResourceDiscoveredByCiv(newResource, It.IsAny <ICivilization>())) .Returns(data.IsVisibleToCiv); return(newResource); }