Esempio n. 1
0
        public ActionResult Index()
        {
            logger.Debug("クラス内に書いたログ - HomeController Index");
            logger.Debug("コンストラクタの扱いを以下でテスト");

            TestConstructor testConstructor = new TestConstructor("pre test");

            return(View());
        }
Esempio n. 2
0
        public void ConstructorTest()
        {
            TestConstructor testConstructor = Faker.Create <TestConstructor>();

            Assert.IsNotNull(testConstructor);
            Assert.AreEqual(testConstructor.Int, -10);
            Assert.AreEqual(testConstructor.String, "done");
            Assert.AreEqual(testConstructor.Bool, false);
        }
Esempio n. 3
0
 public static SingularYield getTestSingularGameResourceYield(
     GameResourceType type = null,
     int value             = 123
     )
 {
     type = type ?? getTestGameResourceType();
     return(TestConstructor.testBuildObject(
                () => new SingularYield(type, value)
                ));
 }
Esempio n. 4
0
 public static ResourceStockpile GetTestResourceYield(
     GameResourceType type = null,
     int value             = 100
     )
 {
     type = type ?? GameResourceTest.getTestGameResourceType();
     return(TestConstructor.testBuildObject(
                () => new ResourceStockpile(type, value)
                ));
 }
Esempio n. 5
0
        public static ResourceYield GetTestFinishedGameResourceYield(
            params SingularYield[] yields
            )
        {
            var unfinishedYield = GetTestResourceYield(yields);

            return(TestConstructor.testBuildObject(
                       () => unfinishedYield.readOnly()
                       ));
        }
Esempio n. 6
0
        public static AbstractImage GetTestAbstractImage(
            int?id      = null,
            string path = null
            )
        {
            int _id = id.GetValueOrDefault(0);

            path = path ?? "/dev/null";
            return(TestConstructor.testBuildObject(
                       () => new AbstractImage(
                           id: _id,
                           path: path
                           )
                       ));
        }
Esempio n. 7
0
 public static GameResourceType getTestGameResourceType(
     int id      = 0,
     string name = "TestResourceType",
     string desc = "TestDescription",
     string unit = "TestUnit"
     )
 {
     return(TestConstructor.testBuildObject(
                () => new GameResourceType(
                    id: id,
                    name: name,
                    description: desc,
                    units: unit
                    )
                ));
 }
Esempio n. 8
0
        public static MutableResourceYield GetTestResourceYield(
            params SingularYield[] yields
            )
        {
            yields = yields ?? new[] { getTestSingularGameResourceYield() };
            return(TestConstructor.testBuildObject(
                       () => {
                var unfinishedYield = new MutableResourceYield();
                foreach (var yield in yields)
                {
                    unfinishedYield.Add(yield);
                }

                return unfinishedYield;
            }
                       ));
        }
Esempio n. 9
0
        public static PlanetType getTestPlanetType(
            ElementId?id         = null,
            AbstractImage image  = null,
            string name          = "TestPlanetType",
            string desc          = "TestDescription",
            YieldCalculator calc = null
            )
        {
            ElementId _id = id.GetValueOrDefault(0);

            image = image ?? AbstractResourceTest.GetTestAbstractImage();
            calc  = calc ?? NULL_YIELD;
            return(TestConstructor.testBuildObject(
                       () => new PlanetType(
                           id: _id,
                           icon: image,
                           name: name,
                           description: desc,
                           yieldCalculator: calc
                           )
                       ));
        }
Esempio n. 10
0
        public static ClusterType getTestClusterType(
            ElementId?id        = null,
            AbstractImage image = null,
            string name         = "TestClusterType",
            string desc         = "TestDescription",
            YieldModifier mod   = null
            )
        {
            ElementId _id = id.GetValueOrDefault(0);

            image = image ?? AbstractResourceTest.GetTestAbstractImage();
            mod   = mod ?? NOOP_MODIFIER;
            return(TestConstructor.testBuildObject(
                       () => new ClusterType(
                           id: _id,
                           icon: image,
                           name: name,
                           description: desc,
                           yieldModifier: mod
                           )
                       ));
        }
Esempio n. 11
0
        public static void Test15()
        {
            TestConstructor test = new TestConstructor();

            test.ArrayLengthTest();
        }