Пример #1
0
        public void CancellingChangesCorrectlyRestoresOriginalValues()
        {
            // arrange
            const bool executeSaveSuccess = true;
            var        sut = new ReconfigurableImplementationFixture(executeSaveSuccess);

            sut.LoadSettingsAsync().Wait();
            sut.TestProperty = false;
            sut.TestProperty.Should().BeFalse();

            // act
            sut.CancelChanges();

            // assert
            sut.TestProperty.Should().BeTrue();
            sut.DataCanBePersisted.Should().BeFalse();
            sut.UnsavedChanges.Should().BeFalse();
        }
Пример #2
0
        public void LoadingSettingsWorksCorrectly()
        {
            // arrange
            var        settingUpdateCalled = false;
            const bool executeSaveSuccess  = true;
            var        sut = new ReconfigurableImplementationFixture(executeSaveSuccess);

            sut.SettingUpdated += (sender, args) =>
            {
                settingUpdateCalled = true;
            };

            // act
            sut.LoadSettingsAsync().Wait();

            // assert
            settingUpdateCalled.Should().BeFalse();
            sut.DataLoadExecutions.Should().Be(1);
            sut.DataCanBePersisted.Should().BeFalse();
            sut.UnsavedChanges.Should().BeFalse();
        }