本文整理汇总了C#中Parent.CreateChild方法的典型用法代码示例。如果您正苦于以下问题:C# Parent.CreateChild方法的具体用法?C# Parent.CreateChild怎么用?C# Parent.CreateChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parent
的用法示例。
在下文中一共展示了Parent.CreateChild方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
parent = new Parent("Mike Hadlow", "[email protected]", "pwd");
child = parent.CreateChild("Leo", "leohadlow", "xxx");
somebodyElse = new Parent("John Robinson", "[email protected]", "pwd");
somebodyElsesChild = somebodyElse.CreateChild("Jim", "jimrobinson", "yyy");
}
示例2: LoadTestData
protected override void LoadTestData()
{
var mike = new Parent("Mike Hadlow", "[email protected]", "yyy");
Session.Save(mike);
Child leo = mike.CreateChild("Leo", "leohadlow", "xxx");
Child yuna = mike.CreateChild("Yuna", "yunahadlow", "xxx");
Session.Save(leo);
Session.Save(yuna);
var john = new Parent("John Robinson", "[email protected]", "yyy");
Session.Save(john);
Child jim = john.CreateChild("Jim", "jimrobinson", "xxx");
Session.Save(jim);
Session.Flush();
}
示例3: SetUp
public void SetUp()
{
mediator = new Mock<IMediator>();
parent = new Parent("Dad", "[email protected]", "xxx");
child = parent.CreateChild("Leo", "leohadlow", "yyy");
parent.MakePaymentTo(child, 10.00M);
somebodyElsesParent = new Parent("Not Dad", "[email protected]", "zzz");
}
示例4: LoadTestData
protected override void LoadTestData()
{
var parent = new Parent("Mike Hadlow", "[email protected]", "yyy");
Session.Save(parent);
parentId = parent.Id;
var child = parent.CreateChild("Leo", "leohadlow", "xxx");
Session.Save(child);
FlushSessionAndEvict(child);
FlushSessionAndEvict(parent);
childId = child.Id;
}
示例5: SetUp
public void SetUp()
{
parent = new Parent("Dad", "[email protected]", "xxx");
child = parent.CreateChild("Leo", "leohadlow", "yyy");
parent.MakePaymentTo(child, 10.00M);
somebodyElsesParent = new Parent("Not Dad", "[email protected]", "zzz");
// make sure these tests pass on non en-GB machines
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
//DomainEvent.TurnOff();
}
示例6: TestParentAndChildRelationsWhenXmlDeserializing
public void TestParentAndChildRelationsWhenXmlDeserializing()
{
var parent = new Parent("Parent");
var child = parent.CreateChild("Child");
Assert.AreEqual(((IParent)child).Parent, parent);
Parent loadedParent;
using (var memoryStream = new MemoryStream())
{
parent.Save(memoryStream, SerializationMode.Xml, null);
memoryStream.Position = 0L;
loadedParent = ModelBase.Load<Parent>(memoryStream, SerializationMode.Xml, null);
}
Assert.AreEqual(parent, ((IParent)loadedParent.Children[0]).Parent);
}
示例7: TestParentAndChildRelationsWhenCreating
public void TestParentAndChildRelationsWhenCreating()
{
var parent = new Parent("Parent");
var child = parent.CreateChild("Child");
Assert.AreEqual(parent, ((IParent)child).Parent);
}
示例8: TestParentAndChildRelationsWhenBinaryDeserializing
public void TestParentAndChildRelationsWhenBinaryDeserializing()
{
var parent = new Parent("Parent");
var child = parent.CreateChild("Child");
Assert.AreEqual(((IParent)child).Parent, parent);
var file = _filesHelper.GetTempFile();
parent.Save(file);
var loadedParent = ModelBase.Load<Parent>(file, SerializationMode.Binary);
Assert.AreEqual(parent, ((IParent)loadedParent.Children[0]).Parent);
}
示例9: TestParentAndChildRelationsWhenBinaryDeserializing
public void TestParentAndChildRelationsWhenBinaryDeserializing()
{
var parent = new Parent("Parent");
var child = parent.CreateChild("Child");
Assert.AreEqual(((IParent)child).Parent, parent);
var file = _filesHelper.GetTempFile();
parent.Save(file);
#if SILVERLIGHT
file.Position = 0L;
#endif
var loadedParent = SavableModelBase<Parent>.Load(file);
Assert.AreEqual(parent, ((IParent)loadedParent.Children[0]).Parent);
}