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

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

            return(View());
        }
Exemplo 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);
        }
Exemplo n.º 3
0
 public static SingularYield getTestSingularGameResourceYield(
     GameResourceType type = null,
     int value             = 123
     )
 {
     type = type ?? getTestGameResourceType();
     return(TestConstructor.testBuildObject(
                () => new SingularYield(type, value)
                ));
 }
Exemplo n.º 4
0
 public static ResourceStockpile GetTestResourceYield(
     GameResourceType type = null,
     int value             = 100
     )
 {
     type = type ?? GameResourceTest.getTestGameResourceType();
     return(TestConstructor.testBuildObject(
                () => new ResourceStockpile(type, value)
                ));
 }
Exemplo n.º 5
0
        public static ResourceYield GetTestFinishedGameResourceYield(
            params SingularYield[] yields
            )
        {
            var unfinishedYield = GetTestResourceYield(yields);

            return(TestConstructor.testBuildObject(
                       () => unfinishedYield.readOnly()
                       ));
        }
Exemplo 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
                           )
                       ));
        }
Exemplo 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
                    )
                ));
 }
Exemplo 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;
            }
                       ));
        }
Exemplo 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
                           )
                       ));
        }
Exemplo 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
                           )
                       ));
        }
Exemplo n.º 11
0
        public static void Test15()
        {
            TestConstructor test = new TestConstructor();

            test.ArrayLengthTest();
        }