Exemplo n.º 1
0
        public void delete_should_remove_the_object_provided_as_an_argument()
        {
            var personToDelete = new Person() { FirstName = "Britton" };
            _subject.Save(personToDelete);
            _subject.Save(new Person() { FirstName = "Cassie" });
            _subject.Delete(personToDelete);
            var people = _subject.Where<Person>(person => true);

            Assert.AreEqual(1, people.Count());
            Assert.AreEqual("Cassie", people.First().FirstName);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Create a new Person object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="firstName">Initial value of the FirstName property.</param>
 public static Person CreatePerson(global::System.Int64 id, global::System.String firstName)
 {
     Person person = new Person();
     person.Id = id;
     person.FirstName = firstName;
     return person;
 }
Exemplo n.º 3
0
 public void WhenILookupThePersonRepositoryForTheNameX(string firstName)
 {
     _person = _subject.FirstOrDefault<Person>(x => x.FirstName == firstName);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the People EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPeople(Person person)
 {
     base.AddObject("People", person);
 }