public void TestResolveWithParameter() { ContainerBuilder containerBuilder = new ContainerBuilder(); containerBuilder.Register("Rabbit", delegate(Container c, object weight) { return(new Rabbit((int)weight)); }); Container container = containerBuilder.Create(); // Rabbit rabbit = (Rabbit)container.Resolve("Rabbit", 55); // Asserts.AssertNotNull(rabbit); Asserts.AssertEquals(55, rabbit.GetWeight()); }
public void TestMultiplyMM() { float[] a = new float[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; float[] b = new float[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; float[] ab = new float[16]; MathMatrix.MultiplyMM(ab, 0, a, 0, b, 0); Asserts.AssertEquals(new float[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, ab); }
public void TestSetItem_passes_when_set_item_duplicated() { LocalStorage.SetItem("Key", "Value"); LocalStorage.SetItem("Key", "Value2"); Asserts.AssertEquals("Value2", LocalStorage.GetItem("Key")); }
public void TestSetItem_passes_when_set_item_exists() { LocalStorage.SetItem("Key", "Value"); Asserts.AssertEquals("Value", LocalStorage.GetItem("Key")); }
public void TestRemoveItem_passes_when_item_exists_and_items_removed() { LocalStorage.SetItem("Key", "Value"); LocalStorage.RemoveItem("Key"); Asserts.AssertEquals(0, LocalStorage.Length); }
public void TestLenght_passes_when_set_single_item_returns_one() { LocalStorage.SetItem("Key", "Value"); Asserts.AssertEquals(1, LocalStorage.Length); }
public void TestKey_passes_when_set_item_key_requested() { LocalStorage.SetItem("Key", "Value"); Asserts.AssertEquals("Key", LocalStorage.Key(0)); }
public void ThenTheResultShouldContain(string result) { Asserts.AssertEquals(_resultsPage.ReturnFirstEmphasis(), result, "Is correct"); }
public void TestSprintfInt32_passes() { Asserts.AssertEquals("test \u0000", CSyntax.SprintfInt32("test %d", 1)); }
public void Test_single_decimal_format() { Asserts.AssertEquals("test \u0000", CSyntax.Sprintf("test %d", new object[] { 1 })); }
public void Test_simple_format() { Asserts.AssertEquals("format", CSyntax.Sprintf("format")); }