Exemple #1
0
        public void ToDocument_RentalId_IdRepresentedAsObjectId()
        {
            var rental = new Rental.Rental();
            rental.Id = ObjectId.GenerateNewId().ToString();

            var bsonDocument = rental.ToBsonDocument();
            Assert.AreEqual(BsonType.ObjectId, bsonDocument["_id"].BsonType);
        }
Exemple #2
0
        public void ToDocument_RentalWithPrice_PriceRepresentedAsDouble()
        {
            var rental = new Rental.Rental();
            rental.Price = 1;

            var bsonDocument = rental.ToBsonDocument();
            Assert.AreEqual( BsonType.Double,bsonDocument["Price"].BsonType);
        }
 public ActionResult Post(PostRental postRental)
 {
     var rental = new Rental.Rental(postRental);
     Context.Rentals.Insert(rental);
     return RedirectToAction("Index");
 }