Ejemplo n.º 1
0
        public void Delete()
        {
            bool             result          = false;
            string           codeSequence    = Aleatory.GetString(8);
            int              correlativo     = Aleatory.GetShort();
            BSequence        bSequence       = new BSequence();
            ESequence        eSequence       = new ESequence(codeSequence, correlativo);
            ESequence        deletedSequence = null;
            ESequence        seletedSequence = null;
            TransactionScope ts = new TransactionScope(TransactionScopeOption.RequiresNew);

            bSequence.Insert(eSequence);
            seletedSequence = bSequence.Select(eSequence);
            if (seletedSequence != null)
            {
                bSequence.Delete(eSequence);
                deletedSequence = bSequence.Select(eSequence);
                if (deletedSequence == null)
                {
                    result = true;
                }
            }

            Assert.AreEqual(result, true);
        }
Ejemplo n.º 2
0
        public void Select()
        {
            short            routes           = 0;
            string           codeSequence     = Aleatory.GetString(8);
            int              correlativo      = Aleatory.GetShort();
            BSequence        bSequence        = new BSequence();
            ESequence        eSequence        = new ESequence(codeSequence, correlativo);
            ESequence        selectedSequence = null;
            TransactionScope ts = new TransactionScope(TransactionScopeOption.RequiresNew);

            selectedSequence = bSequence.Select(eSequence);

            if (selectedSequence == null)
            {
                routes++;
            }

            bSequence.Insert(eSequence);
            selectedSequence = bSequence.Select(eSequence);

            if (selectedSequence != null &&
                selectedSequence.CodeSequence == eSequence.CodeSequence &&
                selectedSequence.Correlative == eSequence.Correlative)
            {
                routes++;
            }

            ts.Dispose();

            Assert.AreEqual(routes, 2);
        }
Ejemplo n.º 3
0
        public void Insert()
        {
            bool             result    = false;
            BAudit           bAudit    = new BAudit();
            List <EAudit>    listAudit = new List <EAudit>();
            BClient          bClient   = new BClient();
            EClient          eClient   = new EClient();
            BSequence        bSequence = new BSequence();
            ESequence        eSequence = null;
            TransactionScope ts        = new TransactionScope(TransactionScopeOption.RequiresNew);

            eClient.CodeTypeDocumentIdentity = "0";
            eClient.NumberIdentity           = Aleatory.GetString(11);
            eClient.FirstName          = Aleatory.GetString(8);
            eClient.SecondName         = Aleatory.GetString(8);
            eClient.FatherLastName     = Aleatory.GetString(8);
            eClient.MotherLastName     = Aleatory.GetString(8);
            eClient.Audit.UserRegister = Aleatory.GetString(8);
            EClient insertedEClient = bClient.Insert(eClient);

            eSequence = new ESequence(eClient);
            eSequence = bSequence.Select(eSequence);

            listAudit = bAudit.Select(eClient.Audit);

            if (insertedEClient != null &&
                listAudit.Exists(x => x.UserRegister == eClient.Audit.UserRegister &&
                                 x.TypeEvent == "Insert" &&
                                 x.Code == insertedEClient.CodeClient.ToString()) &&
                eSequence.Correlative == insertedEClient.CodeClient + 1)
            {
                result = true;
            }

            ts.Dispose();

            Assert.IsTrue(result);
        }
Ejemplo n.º 4
0
    //ビヘイビアの設定
    private void SetUpBT()
    {
        m_BB = GetComponent <BBoard>();
        m_BT = GetComponent <BehaviorTree>();
        m_BT.Init();
        m_BT.SetBoard(m_BB);

        BParallel par_Look_Other = new BParallel();
        //LookAtPlayer
        BT_LookTarget lookTarget      = new BT_LookTarget("target", 5.0f);
        BSelector     sl_Rocket_Other = new BSelector();

        m_BT.SetRootNode(par_Look_Other);

        /*ロケットパンチ*/
        BT_FireRocket BTT_Rocket      = new BT_FireRocket(m_Battery);
        BDecorator    dec_RocektRnage = new BD_CloserThen("target", m_RocketRange);

        BTT_Rocket.AddDecorator(dec_RocektRnage);
        BTT_Rocket.AddDecorator(new BD_CoolTime(m_RocketInterval));

        //接近
        BSequence seq         = new BSequence();
        BT_MoveTo moveToRange = new BT_MoveTo("target", m_Speed);

        moveToRange.m_StopDistance    = m_RocketRange;
        moveToRange.m_IsCanCancelMove = false;
        //moveToRange.AddDecorator(new BD_CloserThen("target", m_NeedMoveDistance).Invert());

        seq.AddNode(moveToRange);

        sl_Rocket_Other.AddNode(BTT_Rocket);
        sl_Rocket_Other.AddNode(seq);
        par_Look_Other.AddNode(lookTarget);
        par_Look_Other.AddNode(sl_Rocket_Other);
    }
Ejemplo n.º 5
0
        public void Insert()
        {
            bool             result           = false;
            string           codeSequence     = Aleatory.GetString(8);
            int              correlativo      = Aleatory.GetShort();
            BSequence        bSequence        = new BSequence();
            ESequence        eSequence        = new ESequence(codeSequence, correlativo);
            ESequence        insertedSequence = null;
            TransactionScope ts = new TransactionScope(TransactionScopeOption.RequiresNew);

            bSequence.Insert(eSequence);
            insertedSequence = bSequence.Select(eSequence);

            if (insertedSequence != null &&
                insertedSequence.CodeSequence == eSequence.CodeSequence &&
                insertedSequence.Correlative == eSequence.Correlative)
            {
                result = true;
            }

            ts.Dispose();

            Assert.AreEqual(result, true);
        }