Beispiel #1
0
        public void Add_AddsTwoNumbersTogether()
        {
            var testOne = new TestOne();
            var result  = testOne.Add(1, 1);

            Assert.Equal(2, result);
        }
Beispiel #2
0
        public void Add_AddsTwoNumbersTogether_Theory(int a, int b, int expected)
        {
            var testOne = new TestOne();
            var result  = testOne.Add(a, b);

            Assert.Equal(expected, result);
        }
Beispiel #3
0
        public IActionResult Get()
        {
            var two = new TestTwo()
            {
                Id   = Guid.NewGuid(),
                Test = "some text 2"
            };

            var one = new TestOne()
            {
                Id        = Guid.NewGuid(),
                Number    = 2,
                Condition = true,
                Text      = "some text 1",
                Elems     = new List <TestTwo>()
                {
                    two
                }
            };

            _context.TestOnes.Add(one);
            _context.SaveChanges();

            return(Ok("Successfully inserted data to db"));
        }
Beispiel #4
0
    void Test()
    {
        GameObject go = Instantiate(Resources.Load("Prefabs/TestOne") as GameObject);
        TestOne    tt = go.GetComponent <TestOne> ();

        if (tt == null)
        {
            tt = go.AddComponent <TestOne> ();
        }
    }
Beispiel #5
0
    public void OnClickBtn()
    {
        GameObject go = Instantiate(Resources.Load("Prefabs/TestOne") as GameObject);
        TestOne    tt = go.GetComponent <TestOne> ();

        if (tt == null)
        {
            tt = go.AddComponent <TestOne> ();
        }
        Close();
    }
        public void TestOneRowOneColumn()
        {
            var test   = new TestOne();
            var actual = Formatter.Format(new[] { test });

            Debug.WriteLine(actual);
            var expected = Clean(@"
o----------o
| FieldOne |
o----------o
| Hello    |
o----------o
");

            Assert.AreEqual(expected, actual);
        }
Beispiel #7
0
        public void ExportMetadata()
        {
            ContainerConfiguration   cfg = new ContainerConfiguration().WithAssembly(Assembly.GetExecutingAssembly());
            ReflectionAndComposition r   = new ReflectionAndComposition();

            using (CompositionHost container = cfg.CreateContainer())
            {
                container.SatisfyImports(r);
            }
            TestOne t = r.ComposObject.Value;

            t.Run();
            IDictionary <string, object> metas = r.ComposObject.Metadata;

            foreach (var kv in metas)
            {
                Console.WriteLine($"Key:{kv.Key}, value: {kv.Value}");
            }
        }
Beispiel #8
0
 public FormletOneSteps()
 {
     testOne = new TestOne();
 }
Beispiel #9
0
    private TestOne testOne;//测试testone
    // Use this for initialization
    void Start()
    {
        testOne = GetComponent <TestOne>(); //获取testone组件

        testOne.ExampleFunction(10);        //调用testone中的函数
    }