예제 #1
0
        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")));
        }
예제 #2
0
        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")));
        }