public async Task GetConfig() { var account = CommonTests.GetAccount(); var mc = new MobileClient(); Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2)); Assert.IsNotNull(await mc.GetConfigAsync()); }
public async Task GetTrack() { var account = CommonTests.GetAccount(); var mc = new MobileClient(); Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2)); Assert.IsNotNull(await mc.GetTrackAsync("Tkou6ps7lrj2wz3c2ejrgar337m")); // Essence, By: Skrux }
public async Task ListPromotedTracksAsync() { var account = GetAccount(); var mc = new MobileClient(); Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2)); Assert.IsNotNull(await mc.ListPromotedTracksAsync()); }
public async Task GetAlbum() { var account = CommonTests.GetAccount(); var mc = new MobileClient(); Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2)); Assert.IsNotNull(await mc.GetAlbumAsync("Bdyocq5dfo3a72heswzl7nhni64")); // Lunch Money - EP, By: SoySauce }
public async Task ExploreTabs() { var account = GetAccount(); var mc = new MobileClient(); Assert.IsTrue(mc.Login(account.Item1, account.Item2)); Assert.IsNotNull(await mc.ExploreTabsAsync()); }
public async Task ListStationCategories() { var account = GetAccount(); var mc = new MobileClient(); Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2)); Assert.IsNotNull(await mc.ListStationCategoriesAsync()); }
public async Task ListPlaylists() { var account = GetAccount(); var mc = new MobileClient(); Assert.IsTrue(mc.Login(account.Item1, account.Item2)); Assert.IsNotNull(await mc.ListPlaylistsAsync()); }
public async Task ListListenNowTracks() { var account = CommonTests.GetAccount(); var mc = new MobileClient(); Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2)); Assert.IsNotNull(await mc.ListListenNowTracksAsync()); }
private void OnDestroy() { if (SceneManager.GetActiveScene().name != Scenes.TitleSceneName) { CommunityData.Instance.Shutdown(); MobileClient.Disconnect(); } }
static void Main(string[] args) { #region Example01 Console.WriteLine("********* Example01 **********"); ContinentFactory africa = new AfricaFactory(); AnimalWorld world = new AnimalWorld(africa); world.RunFoodChain(); ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); #endregion Console.WriteLine(""); #region Example02 Console.WriteLine("********* Example02 **********"); IMobilePhone nokiaMobilePhone = new Nokia(); MobileClient nokiaClient = new MobileClient(nokiaMobilePhone); Console.WriteLine("********* NOKIA **********"); Console.WriteLine(nokiaClient.GetSmartPhoneModelDetails()); Console.WriteLine(nokiaClient.GetNormalPhoneModelDetails()); IMobilePhone samsungMobilePhone = new Samsung(); MobileClient samsungClient = new MobileClient(samsungMobilePhone); Console.WriteLine("******* SAMSUNG **********"); Console.WriteLine(samsungClient.GetSmartPhoneModelDetails()); Console.WriteLine(samsungClient.GetNormalPhoneModelDetails()); #endregion Console.WriteLine(""); #region Example03 Console.WriteLine("********* Example03 **********"); Document[] documents = new Document[2]; documents[0] = new Resume(); documents[1] = new Report(); // Display document pages foreach (Document document in documents) { Console.WriteLine("\n" + document.GetType().Name + "--"); foreach (Page page in document.Pages) { Console.WriteLine(" " + page.GetType().Name); } } #endregion Console.ReadKey(); }
public void OpenLeaveCommunityDialog() { string messageKey = MobileClient.FormatString(StaticDB.GetString("COMMUNITIES_CONFIRM_LEAVE_COMMUNITY_DESCRIPTION", "COMMUNITIES_CONFIRM_LEAVE_COMMUNITY_DESCRIPTION"), this.m_community.Name); Singleton <DialogFactory> .Instance.CreateOKCancelDialog("COMMUNITIES_CONFIRM_LEAVE_COMMUNITY", messageKey, delegate { this.m_community.LeaveOrDestroyClub(); }, null); }
private void OnApplicationQuit() { if (Network.IsConnected() && Network.IsLoggedIn()) { Network.Logout(); } Singleton <Login> .instance.BnQuit(); MobileClient.Shutdown(); }
public async Task CreateDeletePlaylist() { var account = CommonTests.GetAccount(); var mc = new MobileClient(); Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2)); Playlist item; Assert.IsNotNull(item = await mc.CreatePlaylist(Guid.NewGuid().ToString(), "")); Assert.IsNotNull(await mc.DetelePlaylist(item)); }
public void SamsungPhoneTest() { IMobilePhone SamsungMobilePhone = new Samsung(); MobileClient SamsungClient = new MobileClient(SamsungMobilePhone); var descriptionNormalPhone = SamsungClient.GetNormalPhoneModelDetails(); var descriptionSmartPhone = SamsungClient.GetSmartPhoneModelDetails(); descriptionNormalPhone.Equals(Description.SamsungGuru).Should().BeTrue(); descriptionSmartPhone.Equals(Description.SamsungGalaxy).Should().BeTrue(); }
public void NokiaPhoneTest() { IMobilePhone NokiaMobilePhone = new Nokia(); MobileClient NokiaClient = new MobileClient(NokiaMobilePhone); var descriptionNormalPhone = NokiaClient.GetNormalPhoneModelDetails(); var descriptionSmartPhone = NokiaClient.GetSmartPhoneModelDetails(); descriptionNormalPhone.Equals(Description.Nokia1600).Should().BeTrue(); descriptionSmartPhone.Equals(Description.NokiaPixel).Should().BeTrue(); }
public async Task ListPlaylistItems() { var account = CommonTests.GetAccount(); var mc = new MobileClient(); Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2)); ResultList <Playlist> playlist; Assert.IsNotNull(playlist = await mc.ListPlaylistsAsync()); Assert.IsNotNull(await mc.ListTracksFromPlaylist(playlist.Data.Items.First())); }
private async void InitializeGoogleMusicClient() { _mobileClient = new MobileClient(); _isLoggedIn = await _mobileClient.LoginAsync(LoginData.Login, LoginData.Password); if (_isLoggedIn) { await InitPlayLists(); _mainWindow.SearchOnGooglePlayBtn.IsEnabled = true; } }
public void SetMemberInfo(CommunityMember member) { this.m_characterNameText.text = member.Name.ToUpper(); this.m_kickButtonText.text = MobileClient.FormatString(StaticDB.GetString("COMMUNITIES_KICK_MEMBER", "[PH] Kick %s"), this.m_characterNameText.text); this.m_member = member; this.SetRoleToggleState(); this.SetValidAssignableRoles(); this.m_memberRole.onValueChanged.AddListener((bool argument0) => this.SetMemberRole()); this.m_moderatorRole.onValueChanged.AddListener((bool argument1) => this.SetModeratorRole()); this.m_leaderRole.onValueChanged.AddListener((bool argument2) => this.SetLeaderRole()); this.m_ownerRole.onValueChanged.AddListener((bool argument3) => this.SetOwnerRole()); }
private void AddCommunitiesToContent() { GameObject gameObject = this.m_scrollContent.AddAsChildObject(this.m_scrollSectionHeaderPrefab); string text = MobileClient.FormatString("%s'S COMMUNITIES", Singleton <CharacterData> .Instance.CharacterName.ToUpper()); gameObject.GetComponentInChildren <Text>().text = text; CommunityData.Instance.ForEachCommunity(delegate(Community community) { GameObject gameObject2 = this.m_scrollContent.AddAsChildObject(this.m_communityButtonPrefab); gameObject2.GetComponent <CommunityButton>().SetCommunity(community); }); }
public async Task <bool> RetrieveUserData() { var info = await MobileClient.InvokeApiAsync <List <SocialLoginResult> >("/.auth/me"); if (info.FirstOrDefault() is SocialLoginResult result) { UserName = result.GetUserName(); UserEmail = result.GetUserEmail(); UserPicture = result.GetUserPictureURL(); return(true); } return(false); }
public void SamsungFactory() { var factory = new SamsungFactory(); var client = new MobileClient(factory); var normalPhoneRAM = client.GetNormalPhoneRAMDetails(); Assert.AreEqual(normalPhoneRAM, RAMTypes.NA); var smartPhoneRAM = client.GetSmartPhoneRAMDetails(); Assert.AreEqual(smartPhoneRAM, RAMTypes.ThreeGB); }
public void RedmiFactory() { var factory = new RedmiFactory(); var client = new MobileClient(factory); var normalPhoneRAM = client.GetNormalPhoneRAMDetails(); Assert.AreEqual(normalPhoneRAM, RAMTypes.OneGB); var smartPhoneRAM = client.GetSmartPhoneRAMDetails(); Assert.AreEqual(smartPhoneRAM, RAMTypes.TwoGB); }
static void Main(string[] args) { //Abstract Factorys. var nokiaFactory = new Nokia(); var samsungFactory = new Samsung(); var nokiaClient = new MobileClient(nokiaFactory); var samsungClient = new MobileClient(samsungFactory); Console.WriteLine(samsungClient.GetSmartPhoneModelDetails()); Console.WriteLine(nokiaClient.GetSmartPhoneModelDetails()); Console.ReadLine(); }
private void AddInvitationsToContent() { ReadOnlyCollection <CommunityPendingInvite> pendingInvites = CommunityData.Instance.GetPendingInvites(); if (pendingInvites.Count > 0) { GameObject gameObject = this.m_scrollContent.AddAsChildObject(this.m_scrollSectionHeaderPrefab); gameObject.GetComponentInChildren <Text>().text = "PENDING INVITATIONS"; GameObject gameObject2 = this.m_scrollContent.AddAsChildObject(this.m_inviteButtonPrefab); string text = (pendingInvites.Count <= 1) ? "1 INVITE" : "%s INVITATIONS"; text = MobileClient.FormatString(text, pendingInvites.Count.ToString()); gameObject2.GetComponentInChildren <Text>().text = text; gameObject2.GetComponentInChildren <Button>().onClick.AddListener(new UnityAction(this.OpenPendingInvitesDialog)); } }
public async Task ChangePlaylistShareState() { var account = CommonTests.GetAccount(); var mc = new MobileClient(); Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2)); Playlist item; Assert.IsNotNull(item = await mc.CreatePlaylist(Guid.NewGuid().ToString(), "", ShareState.Public)); Assert.IsTrue(await mc.IsPlaylistSharedAsync(item)); item.ShareState = ShareState.Private; Assert.IsNotNull(item = await mc.UpdatePlaylistAsync(item)); Debug.WriteLine(item); Assert.IsFalse(await mc.IsPlaylistSharedAsync(item)); Assert.IsNotNull(await mc.DetelePlaylist(item)); }
public static async void PlayTrack(MobileClient client, Track track) { if (track == null || client == null) { return; } var streamUrl = await client.GetStreamUrlAsync(track); if (streamUrl == null) { return; } _currentTrack = track; PlayTrack(streamUrl); }
public static void AbstractFactory() { IMobilePhone nokiaMobilePhone = new Nokia(); MobileClient nokiaClient = new MobileClient(nokiaMobilePhone); Console.WriteLine("********* NOKIA **********"); Console.WriteLine(nokiaClient.GetSmartPhoneModelDetails()); Console.WriteLine(nokiaClient.GetNormalPhoneModelDetails()); IMobilePhone samsungMobilePhone = new Samsung(); MobileClient samsungClient = new MobileClient(samsungMobilePhone); Console.WriteLine("******* SAMSUNG **********"); Console.WriteLine(samsungClient.GetSmartPhoneModelDetails()); Console.WriteLine(samsungClient.GetNormalPhoneModelDetails()); }
static void Main(string[] args) { IMobilePhone nokiaMobilePhone = new Nokia(); MobileClient nokiaClient = new MobileClient(nokiaMobilePhone); Console.WriteLine(nokiaClient.GetSmartPhoneModelDetails()); Console.WriteLine(nokiaClient.GetNormalPhoneModelDetails()); IMobilePhone samsungMobilePhone = new Samsung(); MobileClient samsungClient = new MobileClient(samsungMobilePhone); Console.WriteLine(samsungClient.GetSmartPhoneModelDetails()); Console.WriteLine(samsungClient.GetNormalPhoneModelDetails()); Console.Read(); }
public static string MainFn() { string result = string.Empty; IMobilePhone nokiaMobilePhone = new Nokia(); MobileClient nokiaClient = new MobileClient(nokiaMobilePhone); result += nokiaClient.GetSmartPhoneModelDetails(); result += nokiaClient.GetNormalPhoneModelDetails(); IMobilePhone samsungMobilePhone = new Samsung(); MobileClient samsungClient = new MobileClient(samsungMobilePhone); result += samsungClient.GetSmartPhoneModelDetails(); result += samsungClient.GetNormalPhoneModelDetails(); return(result); }
private static void GetAbstractFactoryPattern() { ImobilePhone nokiaMobilePhone = new Nokia(); MobileClient nokiaClient = new MobileClient(nokiaMobilePhone); Console.WriteLine("********* NOKIA **********"); Console.WriteLine(nokiaClient.GetSmartPhoneModelDetails()); Console.WriteLine(nokiaClient.GetNormalPhoneModelDetails()); ImobilePhone samsungMobilePhone = new Samsung(); MobileClient samsungClient = new MobileClient(samsungMobilePhone); Console.WriteLine("******* SAMSUNG **********"); Console.WriteLine(samsungClient.GetSmartPhoneModelDetails()); Console.WriteLine(samsungClient.GetNormalPhoneModelDetails()); Console.ReadKey(); }