Beispiel #1
0
        public void Load_WhenPathIsNull_Throws()
        {
            IFileBackingStore test = BuildDefaultFileBackingStoreService();

            test.Path = null;
            Assert.Throws(typeof(InvalidOperationException), () => test.Load());
        }
Beispiel #2
0
        public void Save_WithoutSettingPath_UsesPathFromLocator()
        {
            using (var memoryStream = new MemoryStream())
            {
                _mockLocator.Setup(locator => locator.Path).Returns(ExamplePath);
                _mockStreamService.Setup(stream => stream.GetWriteStream(ExamplePath)).Returns(memoryStream).Verifiable();

                IFileBackingStore test = BuildDefaultFileBackingStoreService();

                test.Save();
                _mockStreamService.Verify();
            }
        }