public void GetRealObject_AuthorBook_UpdateAndAttach_Test() { var dto = new AuthorDTO() { Id = new Guid("44371CFE-E649-4784-ABE5-4C841D572416"), FirstName = "Albert", LastName = "Camus" }; var book = new BookDTO() { Id = new Guid("F917EEEA-ADFC-4451-973E-0FF8CE59BECD"), Title = "L'Entranger", Year = 1942 }; dto.Books.Add(book); var asm = new Assembler(); Author real = asm.GetRealObject(dto, new MockSession_AuthorAndBook()) as Author; Assert.AreEqual(real.Books.Count, 1); Assert.AreEqual(book.Id, real.Books[0].Id); Assert.AreEqual(book.Title, real.Books[0].Title); Assert.AreEqual(book.Year, real.Books[0].Year); Assert.AreEqual(dto.Id, real.Books[0].Author.Id); }
public void GetRealObject_AuthorBook_Delete_Test() { var dto = new AuthorDTO() { Id = new Guid("44371CFE-E649-4784-ABE5-4C841D572416"), FirstName = "Albert", LastName = "Camus" }; var asm = new Assembler(); Author real = asm.GetRealObject(dto, new MockSession_AuthorWithBook()) as Author; Assert.AreEqual(0, real.Books.Count); }
public void GetRealObject_Author_Test() { var dto = new AuthorDTO() { Id = new Guid("44371CFE-E649-4784-ABE5-4C841D572416"), FirstName = "Albert", LastName = "Camus" }; var asm = new Assembler(); Author real = asm.GetRealObject(dto, new MockSession_Author()) as Author; Assert.AreEqual(dto.Id, real.Id); Assert.AreEqual(dto.FirstName, real.FirstName); Assert.AreEqual(dto.LastName, real.LastName); }