public void OneProperty() { var o = new OnePropertyClass { MyProperty = "foo" }; AssertEquals(o.MyProperty, "foo"); }
public void OneField() { var o = new OnePropertyClass { MyField = "foo" }; AssertEquals(o.MyField, "foo"); }
public void OneField() { var o = new OnePropertyClass { MyField = "foo" }; QUnit.AreEqual(o.MyField, "foo"); }
public void OneProperty() { var o = new OnePropertyClass { MyProperty = "foo" }; QUnit.AreEqual(o.MyProperty, "foo"); }
public void OneProperty() { var obj = new OnePropertyClass(); string propertyName = null; obj.PropertyChanged += (sender, evt) => propertyName = evt.PropertyName; obj.StringProperty = "foo"; AssertEquals(propertyName, "StringProperty"); }
public void OneProperty() { var obj = new OnePropertyClass(); string propertyName = null; obj.PropertyChanged += (sender, evt) => propertyName = evt.PropertyName; obj.StringProperty = "foo"; QUnit.AreEqual(propertyName, "StringProperty"); }
public void GetConfContents_GetsOneProperty() { var contents = new OnePropertyClass { StringProp = "The value" }.GetConfContents(); var expected = new KeyValuePair <string, string>("OnePropertyClass.StringProp", "The value"); var actual = contents.Single(); Assert.That(actual, Is.EqualTo(expected)); }
public void Nested() { var o = new OnePropertyClass { NestedProperty = new OnePropertyClass { MyProperty = "foo" } }; AssertEquals(o.NestedProperty.MyProperty, "foo"); }
public void Nested() { var o = new OnePropertyClass { NestedProperty = new OnePropertyClass { MyProperty = "foo" } }; QUnit.AreEqual(o.NestedProperty.MyProperty, "foo"); }
public void CanInjectProperties() { TestingBuilderContext context = GetContext(); object existingObject = new object(); context.Locator.Add(typeof(object), existingObject); context.Policies.Set <ISingletonPolicy>(new SingletonPolicy(true), typeof(object)); IBuildPlanPolicy plan = GetPlanCreator(context).CreatePlan(context, typeof(OnePropertyClass)); OnePropertyClass existing = new OnePropertyClass(); context.Existing = existing; context.BuildKey = typeof(OnePropertyClass); plan.BuildUp(context); Assert.IsNotNull(existing.Key); Assert.AreSame(existingObject, existing.Key); }
public void CanInjectProperties() { TestingBuilderContext context = GetContext(); object existingObject = new object(); SingletonLifetimePolicy lifetimePolicy = new SingletonLifetimePolicy(); lifetimePolicy.SetValue(existingObject); context.Policies.Set <ILifetimePolicy>(lifetimePolicy, typeof(object)); IBuildPlanPolicy plan = GetPlanCreator(context).CreatePlan(context, typeof(OnePropertyClass)); OnePropertyClass existing = new OnePropertyClass(); context.Existing = existing; context.BuildKey = typeof(OnePropertyClass); plan.BuildUp(context); Assert.IsNotNull(existing.Key); Assert.AreSame(existingObject, existing.Key); }
public void CanInjectProperties() { MockBuilderContext context = GetContext(); object existingObject = new object(); var lifetimePolicy = new ContainerControlledLifetimeManager(); lifetimePolicy.SetValue(existingObject); context.Policies.Set <ILifetimePolicy>(lifetimePolicy, new NamedTypeBuildKey <object>()); IBuildPlanPolicy plan = GetPlanCreator(context).CreatePlan(context, new NamedTypeBuildKey(typeof(OnePropertyClass))); OnePropertyClass existing = new OnePropertyClass(); context.Existing = existing; context.BuildKey = new NamedTypeBuildKey(typeof(OnePropertyClass)); plan.BuildUp(context); Assert.NotNull(existing.Key); Assert.Same(existingObject, existing.Key); }