예제 #1
0
    public void CoinLoaderLoadsNumberOfCoins()
    {
        GameObject loaderObject = new GameObject();
        CoinLoader loader       = loaderObject.AddComponent <CoinLoader>();
        Text       text         = loaderObject.AddComponent <Text>();

        loader.coins = -1;

        loader.Start();

        Assert.AreNotEqual(-1, loader.coins);
    }
예제 #2
0
    public void BuyReducesNumberOfCoins()
    {
        GameObject loaderObject = new GameObject();
        CoinLoader loader       = loaderObject.AddComponent <CoinLoader>();
        Text       text         = loaderObject.AddComponent <Text>();

        loader.coins = 2;

        loader.Buy(1);

        Assert.Greater(2, loader.coins);
    }
예제 #3
0
    public void BuyChangesText()
    {
        GameObject loaderObject = new GameObject();
        CoinLoader loader       = loaderObject.AddComponent <CoinLoader>();
        Text       text         = loaderObject.AddComponent <Text>();

        text.text = null;

        loader.Buy(1);

        Assert.IsNotNull(text.text);
    }
예제 #4
0
    public void CoinLoaderSetsText()
    {
        GameObject loaderObject = new GameObject();
        CoinLoader loader       = loaderObject.AddComponent <CoinLoader>();
        Text       text         = loaderObject.AddComponent <Text>();

        text.text = null;

        loader.Start();

        Assert.IsNotNull(text.text);
    }