public void TestCreateGkeDataSource_BuildsFromCurrentAccount()
        {
            CredentialStoreMock.SetupGet(cs => cs.CurrentGoogleCredential).Returns(_userAccount.GetGoogleCredential());

            IGkeDataSource result = _objectUnderTest.CreateGkeDataSource();

            Assert.That.DataSource(result).IsBuiltFrom(_userAccount);
        }
        public void TestGPlusDataSource_Returns()
        {
            CredentialStoreMock.SetupGet(cs => cs.CurrentGoogleCredential).Returns(_userAccount.GetGoogleCredential());

            IGPlusDataSource result = _objectUnderTest.GPlusDataSource;

            Assert.That.DataSource(result).IsBuiltFrom(_userAccount);
        }
        public void TestResourceManagerDataSource_ReturnsNullForNoCredentials()
        {
            CredentialStoreMock.SetupGet(cs => cs.CurrentGoogleCredential).Returns(() => null);

            IResourceManagerDataSource result = _objectUnderTest.ResourceManagerDataSource;

            Assert.IsNull(result);
        }
        public void TestGPlusDataSource_ResetByAccountChange()
        {
            CredentialStoreMock.SetupGet(cs => cs.CurrentGoogleCredential)
            .Returns(() => null);

            IGPlusDataSource emptyCredentailsSource = _objectUnderTest.GPlusDataSource;

            CredentialStoreMock.SetupGet(cs => cs.CurrentGoogleCredential)
            .Returns(_userAccount.GetGoogleCredential());
            CredentialStoreMock.Raise(cs => cs.CurrentAccountChanged += null, EventArgs.Empty);
            IGPlusDataSource updatedCredentialsSource = _objectUnderTest.GPlusDataSource;

            Assert.IsNull(emptyCredentailsSource);
            Assert.That.DataSource(updatedCredentialsSource).IsBuiltFrom(_userAccount);
        }