Exemplo n.º 1
0
        public void TestCreate()
        {
            //setup
            _mockConfiguration.Setup(c => c.LocalStoragePath).Returns(DevPath);

            //act
            var store = new DiskStore(_mockConfiguration.Object);
        }
Exemplo n.º 2
0
        public void TestRead_FileDoesNotExist()
        {
            //setup
            var nonExistingFile = Guid.NewGuid().ToString();
            _mockConfiguration.Setup(c => c.LocalStoragePath).Returns(nonExistingFile);
            var store = new DiskStore(_mockConfiguration.Object);

            //act
            var document = store.Read();

            //assert
            Assert.IsNull(document);
        }
Exemplo n.º 3
0
        public void TestRead()
        {
            //setup
            var license = TestLicense.Load("LicenseGood.xml") as XmlDocument;
            license.Save(DevPath);
            _mockConfiguration.Setup(c => c.LocalStoragePath).Returns(DevPath);
            var store = new DiskStore(_mockConfiguration.Object);

            //act
            var document = store.Read();

            //assert
            Assert.IsNotNull(document);
            Assert.AreEqual(license, document);
        }
Exemplo n.º 4
0
        public void TestSave()
        {
            //setup
            _mockConfiguration.Setup(c => c.LocalStoragePath).Returns(DevPath);
            var store = new DiskStore(_mockConfiguration.Object);
            var licenseDoc = TestLicense.Load("LicenseGood.xml");

            //act
            store.Save(licenseDoc);

            //verify
            Assert.IsTrue(File.Exists(DevPath));
        }
Exemplo n.º 5
0
 public void TestCreate_NullConfig()
 {
     var store = new DiskStore(null);
 }
Exemplo n.º 6
0
        public void TestSave_NullArg()
        {
            //setup
            _mockConfiguration.Setup(c => c.LocalStoragePath).Returns(DevPath);
            var store = new DiskStore(_mockConfiguration.Object);

            //act
            store.Save(null);
        }