예제 #1
0
        public void GenerateEnvTransformDocument_HandlesNullAndEmpty()
        {
            // Arrange
            GenerateEnvTransform env = new GenerateEnvTransform();

            // Act
            XDocument transformDoc = env.GenerateEnvTransformDocument(null, null);

            // Assert
            Assert.Null(transformDoc);
        }
예제 #2
0
        public void GenerateEnvTransform_GeneretesTransforms_ForAllCases(string envVariables, int expected)
        {
            GenerateEnvTransform env = new GenerateEnvTransform();
            IList <XDocument>    templateDocumentList = new List <XDocument>()
            {
                _environmentTransformWithLocationTemplate, _environmentTransformWithoutLocationTemplate
            };

            foreach (var template in templateDocumentList)
            {
                // Act
                XDocument envDoc = env.GenerateEnvTransformDocument(template, envVariables);

                // Assert
                Assert.Equal(expected, envDoc.Descendants("environmentVariable").Count());
            }
        }