Exemplo n.º 1
0
        public void when_store_throws_ex_returns_default_appsettings()
        {
            // Arrange
            var @default = new AppSettings();
            store.Expect(x => x.LoadXml(Arg<string>.Is.Anything)).Throw(new Exception());

            // Act
            var loaded = file.Load();

            // Assert
            Assert.Equal(@default.AppTitle, loaded.AppTitle);
            Assert.Equal(@default.ContactEmail, loaded.ContactEmail);
        }
Exemplo n.º 2
0
 public SettingsFileTest()
 {
     store = MockRepository.GenerateMock<IXmlFileStore>();
     file = new SettingsFile<AppSettings>("TestFile", store);
     settings = new AppSettings();
 }