зеркало из https://github.com/github/VisualStudio.git
Ensure Accounts is not null
This commit is contained in:
Родитель
29248e641f
Коммит
018ede51ab
|
@ -29,6 +29,8 @@ namespace GitHub.ViewModels
|
|||
{
|
||||
this.operatingSystem = operatingSystem;
|
||||
|
||||
Accounts = new ReactiveList<IAccount>();
|
||||
|
||||
safeRepositoryName = this.WhenAny(x => x.RepositoryName, x => x.Value)
|
||||
.Select(x => x != null ? GetSafeRepositoryName(x) : null)
|
||||
.ToProperty(this, x => x.SafeRepositoryName);
|
||||
|
|
|
@ -72,4 +72,14 @@ public class RepositoryCreationViewModelTests
|
|||
Assert.Equal(@"c:\fake\dev", vm.BaseRepositoryPath);
|
||||
}
|
||||
}
|
||||
|
||||
public class TheAccountsProperty
|
||||
{
|
||||
[Fact]
|
||||
public void StartsOffEmpty()
|
||||
{
|
||||
var vm = new RepositoryCreationViewModel(Substitute.For<IOperatingSystem>());
|
||||
Assert.Empty(vm.Accounts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче