Пример #1
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);
        }
Пример #2
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);
        }