public void Add_AddsTwoNumbersTogether() { var testOne = new TestOne(); var result = testOne.Add(1, 1); Assert.Equal(2, result); }
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); }
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")); }
void Test() { GameObject go = Instantiate(Resources.Load("Prefabs/TestOne") as GameObject); TestOne tt = go.GetComponent <TestOne> (); if (tt == null) { tt = go.AddComponent <TestOne> (); } }
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); }
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}"); } }
public FormletOneSteps() { testOne = new TestOne(); }
private TestOne testOne;//测试testone // Use this for initialization void Start() { testOne = GetComponent <TestOne>(); //获取testone组件 testOne.ExampleFunction(10); //调用testone中的函数 }