Ejemplo n.º 1
0
        public void ReturnNullIfVersionNotFoundTest()
        {
            var powerShellFileProvisioner = new PowerShellFileProvisioner(_loggerFactory);

            string streamContent = FileUtility.ReadResourceString(PSGalleryEmptyFeedResourceFileName);

            using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(streamContent)))
            {
                string version = powerShellFileProvisioner.GetModuleMajorVersion(stream);
                Assert.Equal(null, version);
            }
        }
Ejemplo n.º 2
0
        public void FindLatestMajorVersionTest()
        {
            var powerShellFileProvisioner = new PowerShellFileProvisioner(_loggerFactory);

            string streamContent = FileUtility.ReadResourceString(PSGallerySampleFeedResourceFileName);

            using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(streamContent)))
            {
                string version = powerShellFileProvisioner.GetModuleMajorVersion(stream);
                Assert.Equal("7", version);
            }
        }