public void GetGene_Returns_CorrectGene() { var featureModel = A.Fake <FeatureModel>(); var genes = new[] { new DeploymentGene(new FeatureIdentifier("a"), new MicroserviceIdentifier("a")), new DeploymentGene(new FeatureIdentifier("b"), new MicroserviceIdentifier("b")) }; var sot = new DeploymentChromosome(featureModel, genes); Assert.AreEqual(genes[0], sot.GetGene(new FeatureIdentifier("a"))); }
public void UpdateGene_ToSameMicroservice_Returns_SameDeployment() { var featureModel = A.Fake <FeatureModel>(); var genes = new[] { new DeploymentGene(new FeatureIdentifier("a"), new MicroserviceIdentifier("a")), new DeploymentGene(new FeatureIdentifier("b"), new MicroserviceIdentifier("b")) }; var sot = new DeploymentChromosome(featureModel, genes); sot = (DeploymentChromosome)sot.UpdateGene(genes[0]); Assert.AreEqual(genes[0], sot.GetGene(new FeatureIdentifier("a"))); }