public void EditPluginCode_ShouldReturnInitialVersion_WhenChangesHaveBeenRejected() { const string initialSource = "namespace test {}"; const string editedSource = "namespace foo {}"; var builder = new CodeEditorServiceBuilder() .WithDialogReault(CommonDialogResult.Cancel); Mock.Get(builder.ViewModel).SetupGet(vm => vm.SourceCode).Returns(editedSource); var codeEditor = builder.Build(); var result = codeEditor.EditPluginCode(initialSource); result.Should().Be(initialSource); }