Esempio 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);
        }
 /// <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;
 }
 public void WhenILookupThePersonRepositoryForTheNameX(string firstName)
 {
     _person = _subject.FirstOrDefault<Person>(x => x.FirstName == firstName);
 }
 /// <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);
 }