Exemple #1
0
        public void SetExtensionVersion_ArgumentNullException()
        {
            // Arrange
            var dna = Mock.Of <IDotNetAccess>();
            IExtensionVersionService evs = new ExtensionVersionService(dna);

            // Act & Assert
            Assert.Throws <ArgumentNullException>(() => evs.SetExtensionVersion(null));
        }
Exemple #2
0
        public void SetExtensionVersion_ProvideVersion()
        {
            // Arrange
            var version = new Version(50, 10, 0, 4);
            var dnaMock = new Mock <IDotNetAccess>();

            dnaMock.Setup(m => m.GetExtensionVersion()).Returns(version);
            var aem = new AboutExtensionModel();
            IExtensionVersionService evs = new ExtensionVersionService(dnaMock.Object);

            // Act
            evs.SetExtensionVersion(aem);

            // Assert
            Assert.AreSame(version, aem.ExtensionVersion);
        }