public void ToDocument_RentalWithId() { var rental = new Rental(); rental.Id = ObjectId.GenerateNewId().ToString(); var document = rental.ToBsonDocument(); Expect(document["_id"].BsonType, Is.EqualTo(BsonType.ObjectId)); }
public void ToDocument_RentalWithPrice() { var rental = new Rental(); rental.Price = 1; var document = rental.ToBsonDocument(); Expect(document["Price"].BsonType, Is.EqualTo(BsonType.Double)); }
public void ToDocument_RentalWithAnId_IdIsRepresentedAsAnObjectId() { var rental = new Rental { Id = ObjectId.GenerateNewId().ToString() }; var document = rental.ToBsonDocument(); Expect(document["_id"].BsonType, Is.EqualTo(BsonType.ObjectId)); }
public void ToDocument_RentalWithPrice_PriceRepresentedAsDouble() { // Arrange var rental = new Rental(); rental.Price = 1; // Act var document = rental.ToBsonDocument(); // Assert Assert.AreEqual(document["Price"].BsonType, BsonType.Double); }
public void ToDocument_RentalWithAnId_IdIsRepresentedAsAnObjectId() { // Arrange var rental = new Rental(); rental.Id = ObjectId.GenerateNewId().ToString(); // Act var document = rental.ToBsonDocument(); // Assert Assert.AreEqual(document["_id"].BsonType, BsonType.ObjectId); }
// METHOD_SCENARIO_EXPECTATION public void ToDocument_RentalWithPrice_PriceRepresentedAsDouble() { var rental = new Rental{Price = 1}; var document = rental.ToBsonDocument(); Expect(document["Price"].BsonType, Is.EqualTo(BsonType.Double)); }