Пример #1
0
        public void GetVerseTest_Optimistic_First_BadBook()
        {
            //Repository_Accessor target = new Repository_Accessor();
            string         book     = "not a book";
            int            chapter  = 5;
            int            verse    = 19;
            string         suffix   = "b";
            VersePosition  position = VersePosition.First;
            RepositoryMode mode     = RepositoryMode.Optimistic;
            Verse          expected = null;
            Verse          actual;

            actual = Verse.Create(si, book, chapter, verse, suffix, position, mode);
            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void GetVerseTest_Strict_Last_VerseTooLarge()
        {
            //Repository_Accessor target = new Repository_Accessor();
            string         book     = "lev";
            int            chapter  = 5;
            int            verse    = 5000;
            string         suffix   = null;
            VersePosition  position = VersePosition.Last;
            RepositoryMode mode     = RepositoryMode.Strict;
            Verse          expected = null;
            Verse          actual;

            actual = Verse.Create(si, book, chapter, verse, suffix, position, mode);
            Assert.AreEqual(expected, actual);
        }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        cameraController = GameObject.Find("Main Camera").GetComponent <CameraController>();


        scriptLoader = new ScriptLoader();

        Verse = new Verse();

        SpriteController spriteController = gameObject.AddComponent <SpriteController>();

        spriteController.Load();

        string pathXml = Path.Combine(Application.streamingAssetsPath, "Data/Prototypes/Parts.xml");

        Verse.registry.partRegistry.ReadPrototypes(pathXml);
        pathXml = Path.Combine(Application.streamingAssetsPath, "Data/Prototypes/Entities.xml");
        Verse.registry.entityRegistry.ReadPrototypes(pathXml);

        gameObject.AddComponent <GUIController>();
        shipController = gameObject.AddComponent <ShipController>();
        gameObject.AddComponent <InputController>();

        VerseComponent verseComponent = gameObject.AddComponent <VerseComponent>();

        Verse.register(verseComponent);

        GameObject overlay = new GameObject("Overlay");

        overlay.transform.SetParent(cameraController.transform);
        overlayComponent = overlay.AddComponent <OverlayComponent>();
        Verse.register(overlayComponent);

        galaxy = new GameObject("StarMap");
        GalaxyComponent galaxyComponent = galaxy.AddComponent <GalaxyComponent>();

        galaxyComponent.Camera           = GameObject.Find("MapCamera").GetComponent <Camera>();
        galaxyComponent.vert             = starmapVertex;
        galaxyComponent.starPathMaterial = starmapEdgeMaterial;

        Verse.Galaxy.register(galaxyComponent);

        Verse.Create();

        Verse.SetMap("Health");

        SetMode(ViewMode.Ship);
    }
Пример #4
0
        public void GetVerseTest_Strict_Last_NoVerse()
        {
            //Repository_Accessor target = new Repository_Accessor();
            string         book     = "lev";
            int            chapter  = 5;
            int            verse    = -1;
            string         suffix   = null;
            VersePosition  position = VersePosition.Last;
            RepositoryMode mode     = RepositoryMode.Strict;
            Verse          expected = new Verse
            {
                Index         = 2850,
                BookName      = "Leviticus",
                BookNumber    = 3,
                ChapterNumber = 5,
                VerseNumber   = 19,
                Suffix        = null
            };
            Verse actual;

            actual = Verse.Create(si, book, chapter, verse, suffix, position, mode);
            Assert.AreEqual(expected, actual);
        }
Пример #5
0
        public void GetVerseTest_Optimistic_First_Normal()
        {
            //Repository_Accessor target = new Repository_Accessor();
            string         book     = "lev";
            int            chapter  = 5;
            int            verse    = 19;
            string         suffix   = "b";
            VersePosition  position = VersePosition.First;
            RepositoryMode mode     = RepositoryMode.Optimistic;
            Verse          expected = new Verse
            {
                Index         = 2850,
                BookName      = "Leviticus",
                BookNumber    = 3,
                ChapterNumber = 5,
                VerseNumber   = 19,
                Suffix        = "b"
            };
            Verse actual;

            actual = Verse.Create(si, book, chapter, verse, suffix, position, mode);
            Assert.AreEqual(expected, actual);
        }
Пример #6
0
        public void GetVerseTest_Optimistic_Last_ChapterTooLarge()
        {
            //Repository_Accessor target = new Repository_Accessor();
            string         book     = "lev";
            int            chapter  = 5000;
            int            verse    = -1;
            string         suffix   = null;
            VersePosition  position = VersePosition.Last;
            RepositoryMode mode     = RepositoryMode.Optimistic;
            Verse          expected = new Verse
            {
                Index         = 3605,
                BookName      = "Leviticus",
                BookNumber    = 3,
                ChapterNumber = 27,
                VerseNumber   = 34,
                Suffix        = null
            };
            Verse actual;

            actual = Verse.Create(si, book, chapter, verse, suffix, position, mode);
            Assert.AreEqual(expected, actual);
        }