Skip to content

Commit 50adb87

Browse files
committed
Add tests
1 parent d6dd3ba commit 50adb87

File tree

5 files changed

+1035
-797
lines changed

5 files changed

+1035
-797
lines changed

RetailCoder.VBE/UI/RubberduckUI.Designer.cs

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RetailCoder.VBE/UI/RubberduckUI.resx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,4 +1623,10 @@ All our stargazers, likers & followers, for the warm fuzzies
16231623
<data name="SourceControl_CreateNewRemoteRepoButtonToolTip" xml:space="preserve">
16241624
<value>Upload repository to GitHub</value>
16251625
</data>
1626+
<data name="SourceControl_CreateNewRemoteRepo_FailureTitle" xml:space="preserve">
1627+
<value>Create new remote repository.</value>
1628+
</data>
1629+
<data name="SourceControl_CreateNewRemoteRepo_NoOpenRepo" xml:space="preserve">
1630+
<value>No open repository to push to specified remote location.</value>
1631+
</data>
16261632
</root>

RetailCoder.VBE/UI/SourceControl/ChangesViewViewModel.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -168,24 +168,24 @@ private void Commit()
168168
}
169169

170170
RefreshView();
171+
172+
switch (CommitAction)
173+
{
174+
case CommitAction.Commit:
175+
RaiseErrorEvent(RubberduckUI.SourceControl_CommitStatus, RubberduckUI.SourceControl_CommitStatus_CommitSuccess, NotificationType.Info);
176+
return;
177+
case CommitAction.CommitAndPush:
178+
RaiseErrorEvent(RubberduckUI.SourceControl_CommitStatus, RubberduckUI.SourceControl_CommitStatus_CommitAndPushSuccess, NotificationType.Info);
179+
return;
180+
case CommitAction.CommitAndSync:
181+
RaiseErrorEvent(RubberduckUI.SourceControl_CommitStatus, RubberduckUI.SourceControl_CommitStatus_CommitAndSyncSuccess, NotificationType.Info);
182+
return;
183+
}
171184
}
172185
catch (SourceControlException ex)
173186
{
174187
RaiseErrorEvent(ex.Message, ex.InnerException.Message, NotificationType.Error);
175188
}
176-
177-
switch (CommitAction)
178-
{
179-
case CommitAction.Commit:
180-
RaiseErrorEvent(RubberduckUI.SourceControl_CommitStatus, RubberduckUI.SourceControl_CommitStatus_CommitSuccess, NotificationType.Info);
181-
return;
182-
case CommitAction.CommitAndPush:
183-
RaiseErrorEvent(RubberduckUI.SourceControl_CommitStatus, RubberduckUI.SourceControl_CommitStatus_CommitAndPushSuccess, NotificationType.Info);
184-
return;
185-
case CommitAction.CommitAndSync:
186-
RaiseErrorEvent(RubberduckUI.SourceControl_CommitStatus, RubberduckUI.SourceControl_CommitStatus_CommitAndSyncSuccess, NotificationType.Info);
187-
return;
188-
}
189189
}
190190

191191
private void IncludeChanges(IFileStatusEntry fileStatusEntry)

RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,15 +575,24 @@ private void CreateNewRemoteRepo()
575575
{
576576
try
577577
{
578+
if (Provider == null)
579+
{
580+
ViewModel_ErrorThrown(null,
581+
new ErrorEventArgs(RubberduckUI.SourceControl_CreateNewRemoteRepo_FailureTitle,
582+
RubberduckUI.SourceControl_CreateNewRemoteRepo_NoOpenRepo, NotificationType.Error));
583+
return;
584+
}
585+
578586
Provider.AddOrigin(CreateNewRemoteRemotePath, RemoteBranchName);
579587

580588
Provider.Publish(RemoteBranchName);
581-
DisplayCreateNewRemoteRepoGrid = false;
582589
}
583590
catch (SourceControlException ex)
584591
{
585592
ViewModel_ErrorThrown(null, new ErrorEventArgs(ex.Message, ex.InnerException.Message, NotificationType.Error));
586593
}
594+
595+
CloseCreateNewRemoteRepoGrid();
587596
}
588597

589598
private void ShowCloneRepoGrid()
@@ -605,7 +614,8 @@ private void ShowCreateNewRemoteRepoGrid()
605614

606615
private void CloseCreateNewRemoteRepoGrid()
607616
{
608-
CloneRemotePath = string.Empty;
617+
CreateNewRemoteRemotePath = string.Empty;
618+
RemoteBranchName = string.Empty;
609619

610620
DisplayCreateNewRemoteRepoGrid = false;
611621
}

0 commit comments

Comments
 (0)