public void CoinMappingSucceeds() { var uri = new Uri("https://rprcorporate.blob.core.windows.net/media/sampletrophy.png?sp=rl&st=2021-03-28T19:06:34Z&se=2025-03-29T19:06:00Z&sv=2020-02-10&sr=b&sig=M3oKCysFeKGWw7jDnn1kCFNTFHdqxoOtKVzVFIYXXZs%3D"); var a = new Coin().ToMock(uri); var ad = new CoinDisplay().Map(a); Assert.IsTrue(a.SimpleName == ad.SimpleName); Assert.IsTrue(a.MediaTranslations[0].SelectedMediaUri.Uri.AbsoluteUri == ad.MediaTranslations[0].SelectedMediaUri.Uri.AbsoluteUri); }
private void Start() { _itemDisplay = FindObjectOfType <ItemDisplay>(); _coinDisplay = FindObjectOfType <CoinDisplay>(); _itemDisplay.UpdateContainers(_inventoryObject.GetItems().Count); _itemDisplay.UpdateSelectedItem(_selectedItem); _itemDisplay.UpdateItems(_inventoryObject.GetItems()); _coinDisplay.UpdateCoins(_inventoryObject.GetCoins()); }
public void TestCoinBalanceMocking() { var uri = new Uri("https://rprcorporate.blob.core.windows.net/media/sampletrophy.png?sp=rl&st=2021-03-28T19:06:34Z&se=2025-03-29T19:06:00Z&sv=2020-02-10&sr=b&sig=M3oKCysFeKGWw7jDnn1kCFNTFHdqxoOtKVzVFIYXXZs%3D"); var cbd = new CoinBalanceDisplay().ToMock(uri); Assert.IsTrue(cbd.Balance > 0.0M); var a1 = new CoinDisplay().ToMock(uri); Assert.IsTrue(!string.IsNullOrEmpty(a1.SimpleName)); }
public static CoinDisplay Map(this CoinDisplay to, Coin from) { var config = new MapperConfiguration(cfg => { cfg.AddProfile <CoinProfile>(); }); IMapper mapper = new Mapper(config); mapper.Map(from, to); return(to); }
// Use this for initialization void Start() { flickDisplay.text = "SHOTS " + flicksLeft.ToString(); //TODO remove game manager from start and level select scenes CoinDisplay = FindObjectOfType <CoinDisplay>(); scoreCrown = GameObject.Find("Score Crown").GetComponent <Image>(); //LargeScoreCrown = GameObject.Find("Large Score Crown").GetComponent<Image>(); //Coin1 = GameObject.Find("Collectable").GetComponent<Image>(); //Coin2 = GameObject.Find("Collectable2").GetComponent<Image>(); //Coin3 = GameObject.Find("Collectable3").GetComponent<Image>(); if (bInTutorial) { skipProgressBar.maxValue = skipThreshold; } }
public static CoinDisplay ToMock(this CoinDisplay cb, Uri uri) { var rnd = new Random(Guid.NewGuid().GetHashCode()); string rawText = Lipsums.LoremIpsum; LipsumGenerator lipsum = new LipsumGenerator(rawText, false); var last = $"{lipsum.GenerateWords(1)[0]}"; var first = $"{lipsum.GenerateWords(1)[0]}"; var profile = $"{first}.{last}.{Guid.NewGuid().ToString("N").Substring(4)}".ToLower(); return(new CoinDisplay() { EntityRefId = Guid.NewGuid(), SimpleName = $"{lipsum.GenerateWords(1)[0]}", NameTranslations = new StringTranslationsCore().Map(new StringTranslations().ToMock()), MediaTranslations = new MediaTranslationsCore().Map(new MediaTranslations().ToMock(uri)) }); }