Exemplo n.º 1
0
        public void ThenPubnubShouldGenerateUniqueIdentifier()
        {
            Debug.Log("Running ThenPubnubShouldGenerateUniqueIdentifier()");
            Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);

            UUnitAssert.NotNull(pubnub.GenerateGuid());
        }
Exemplo n.º 2
0
    void GetProducerCallback(string res)
    {
        JsonData jd       = JsonMapper.ToObject(res);
        Producer producer = new Producer((int)(jd[Param.PRODUCER_ID]),
                                         (string)(jd[Param.NAME]),
                                         (string)(jd[Param.DETAILS]),
                                         StringUtil.StringToDateTime((string)(jd[Param.MODIFIED])));

        UUnitAssert.NotNull(producer);
    }
Exemplo n.º 3
0
    void GetAllSceneTypeCallback(string res)
    {
        JsonData jd = JsonMapper.ToObject(res);

        UUnitAssert.True(jd.IsArray);
        SceneType sceneType = new SceneType((int)(jd[0][Param.TYPE_ID]), (string)(jd[0][Param.NAME]), (string)jd[Param.PICTURE_ID],
                                            StringUtil.StringToDateTime((string)(jd[0][Param.MODIFIED])));

        UUnitAssert.NotNull(sceneType);
    }
Exemplo n.º 4
0
    void GetScenesCallback(string res)
    {
        JsonData jd = JsonMapper.ToObject(res);

        UUnitAssert.True(jd.IsArray);
        Scene scene = new Scene((int)(jd[0][Param.SCENE_ID]), (string)(jd[0][Param.NAME]),
                                (int)(jd[0][Param.TYPE_ID]), (string)(jd[0][Param.PIC_URL]),
                                (string)(jd[0][Param.DETAILS]), StringUtil.StringToDateTime((string)(jd[0][Param.MODIFIED])),
                                (int)jd[Param.ASSET_ID], (string)jd[Param.PRODUCTS]);

        UUnitAssert.NotNull(scene);
    }
Exemplo n.º 5
0
        protected override void SetUp()
        {
            animation = GameObject.FindObjectOfType(typeof(SpriteAnimation)) as SpriteAnimation;
            UUnitAssert.NotNull(Resources.Load(clothesPath));
            GameObject clothesGo  = Resources.Load(clothesPath) as GameObject;
            GameObject weaponGo   = Resources.Load(weaponPath) as GameObject;
            GameObject clothesGo1 = Resources.Load(clothesPath1) as GameObject;

            clothesPrefab  = clothesGo.GetComponent <Sprite>();
            weaponPrefab   = weaponGo.GetComponent <Sprite>();
            clothesPrefab1 = clothesGo1.GetComponent <Sprite>();
        }
Exemplo n.º 6
0
    void GetProductCallback(string res)
    {
        JsonData jd = JsonMapper.ToObject(res);

        UUnitAssert.True(!jd.IsArray);
        Product product = new Product((int)(jd[Param.PRODUCT_ID]),
                                      (int)(jd[Param.PRODUCER_ID]),
                                      (string)(jd[Param.NAME]),
                                      (int)(jd[Param.CID]),
                                      (string)(jd[Param.SIZE]),
                                      (string)(jd[Param.PIC_URL]),
                                      (string)(jd[Param.DETAILS]),
                                      (int)jd[Param.ASSET_ID],
                                      StringUtil.StringToDateTime((string)(jd[Param.MODIFIED])));

        UUnitAssert.NotNull(product);
    }
Exemplo n.º 7
0
        public void TestAllMethods()
        {
            PrefixTest();

            SpriteLayer clothesLayer = new ClothesLayer();

            SpriteLayer weaponLayer = new WeaponLayer();

            animation.PutLayer(clothesLayer);
            animation.PutLayer(weaponLayer);


            if (animation.IsPlaying)
            {
                animation.Stop();
                UUnitAssert.False(animation.IsPlaying);
                animation.Play();
                UUnitAssert.True(animation.IsPlaying);
            }
            else
            {
                animation.Play();
                UUnitAssert.True(animation.IsPlaying);
                animation.Stop();
                UUnitAssert.False(animation.IsPlaying);
            }

            weaponLayer = animation.GetLayer(LayerID.WEAPON);
            UUnitAssert.NotNull(weaponLayer);
            animation.Clear(weaponLayer);

            weaponLayer = animation.GetLayer(weaponLayer.id);
            UUnitAssert.NotNull(weaponLayer);
            weaponLayer.spritePrefab = weaponPrefab;
            animation.PutLayer(weaponLayer);

            animation.Open(clothesPrefab1, LayerID.CLOTHES);
        }
Exemplo n.º 8
0
        public void WriteTestSequence()
        {
            bool   functionResult, callResult;
            string getErrorReport, saveErrorReport, fetchErrorReport;

            TestSuiteReport[] testResults;
            object            nullReturn;

            // Reset a previous test if relevant
            callResult = CloudScriptListener.ExecuteCloudScript(CloudScriptListener.CSfunc_GetTestData, getRequest, out testResults, out fetchErrorReport);
            UUnitAssert.True(callResult, fetchErrorReport);

            // Verify that no data pre-exists
            callResult = CloudScriptListener.ExecuteCloudScript(CloudScriptListener.CSfunc_TestDataExists, getRequest, out functionResult, out getErrorReport);
            UUnitAssert.True(callResult, getErrorReport);
            UUnitAssert.False(functionResult, getErrorReport);

            // Save some data
            callResult = CloudScriptListener.ExecuteCloudScript(CloudScriptListener.CSfunc_SaveTestData, saveRequest, out nullReturn, out saveErrorReport);
            UUnitAssert.True(callResult, saveErrorReport);

            // Verify that the saved data exists
            callResult = CloudScriptListener.ExecuteCloudScript(CloudScriptListener.CSfunc_TestDataExists, getRequest, out functionResult, out getErrorReport);
            UUnitAssert.True(callResult, getErrorReport);
            UUnitAssert.True(functionResult, saveErrorReport);

            // Fetch that data
            callResult = CloudScriptListener.ExecuteCloudScript(CloudScriptListener.CSfunc_GetTestData, getRequest, out testResults, out fetchErrorReport);
            UUnitAssert.True(callResult, fetchErrorReport);
            UUnitAssert.NotNull(testResults, fetchErrorReport);

            // Verify that it was consumed
            callResult = CloudScriptListener.ExecuteCloudScript(CloudScriptListener.CSfunc_TestDataExists, getRequest, out functionResult, out getErrorReport);
            UUnitAssert.True(callResult, getErrorReport);
            UUnitAssert.False(functionResult, getErrorReport);
        }
Exemplo n.º 9
0
 private void PrefixTest()
 {
     UUnitAssert.NotNull(animation);
     UUnitAssert.NotNull(clothesPrefab);
     UUnitAssert.NotNull(weaponPrefab);
 }