本文整理汇总了C#中Expedia.Hotel类的典型用法代码示例。如果您正苦于以下问题:C# Hotel类的具体用法?C# Hotel怎么用?C# Hotel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Hotel类属于Expedia命名空间,在下文中一共展示了Hotel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TestThatAFlightDoesNotEqualAnotherObject
public void TestThatAFlightDoesNotEqualAnotherObject()
{
var flight = new Flight(StartTime, EndTime, miles);
var hotel = new Hotel(5);
Assert.False(flight.Equals(hotel));
}
开发者ID:veatchje,项目名称:Lab3-veatchje,代码行数:7,代码来源:FlightTest.cs
示例2: TestThatHotelDoesGetRoomOccupantFromTheDatabase
public void TestThatHotelDoesGetRoomOccupantFromTheDatabase()
{
IDatabase mockDatabase = mocks.Stub<IDatabase>();
String roomOccupant = "Whale Rider";
String anotherRoomOccupant = "Raptor Wrangler";
using (mocks.Record())
{
// The mock will return "Whale Rider" when the call is made with 24
mockDatabase.getRoomOccupant(24);
// LastCall.Throw(new Exception());
LastCall.Return(roomOccupant);
// The mock will return "Raptor Wrangler" when the call is made with 1025
mockDatabase.getRoomOccupant(1025);
LastCall.Return(anotherRoomOccupant);
}
var target = new Hotel(10);
target.Database = mockDatabase;
String result;
result = target.getRoomOccupant(1025);
Assert.AreEqual(result, anotherRoomOccupant);
result = target.getRoomOccupant(24);
Assert.AreEqual(result, roomOccupant);
}
开发者ID:HawaiianNinja,项目名称:Lab4-hopkinaj,代码行数:27,代码来源:HotelTest.cs
示例3: TestValidFromDateFile
public void TestValidFromDateFile()
{
var hotel = Hotel.fromDatafile(new[] { "HOTEL", "123" });
var expectedHotel = new Hotel(123);
Assert.AreEqual(expectedHotel, hotel);
}
开发者ID:CSSE376,项目名称:savagejs,代码行数:7,代码来源:HotelTest.cs
示例4: TestThatTwoHotelsEqual
public void TestThatTwoHotelsEqual()
{
var hot1 = new Hotel(4);
var hot2 = new Hotel(4);
Assert.True(hot1.Equals(hot2));
}
开发者ID:Watersdr,项目名称:Lab2-watersdr,代码行数:7,代码来源:HotelTest.cs
示例5: TestThatHotelNotEqualToNonHotel
public void TestThatHotelNotEqualToNonHotel()
{
var hot1 = new Hotel(4);
var notHotel = new User("I'm not a hotel");
Assert.False(hot1.Equals(notHotel));
}
开发者ID:Watersdr,项目名称:Lab2-watersdr,代码行数:7,代码来源:HotelTest.cs
示例6: TestSameHotelsAreEqual
public void TestSameHotelsAreEqual()
{
var h1 = new Hotel(10);
var h2 = new Hotel(10);
Assert.AreEqual(h1, h2);
}
开发者ID:CSSE376,项目名称:savagejs,代码行数:7,代码来源:HotelTest.cs
示例7: TestThatHotelDoesGetRoomCountFromDatabase
public void TestThatHotelDoesGetRoomCountFromDatabase()
{
IDatabase mockDatabase = mocks.Stub<IDatabase>();
List<Int32> Rooms = new List<int>();
for (var i = 0; i < 100; i++)
{
Rooms.Add(i);
}
mockDatabase.Rooms = Rooms;
var target = new Hotel(10);
target.Database = mockDatabase;
int roomCount = target.AvailableRooms;
Assert.AreEqual(roomCount, Rooms.Count);
}
开发者ID:krenztr,项目名称:Lab4-krenztr,代码行数:14,代码来源:HotelTest.cs
示例8: TestThatHotelDoesGetRoomOccupantFromTheDatabaseWithCheck
public void TestThatHotelDoesGetRoomOccupantFromTheDatabaseWithCheck()
{
IDatabase mockDatabase = mocks.Stub<IDatabase>();
String roomOccupant = "Whale Rider";
using (mocks.Record())
{
mockDatabase.isRoomOccupantValid(24);
LastCall.Return(true);
mockDatabase.isRoomOccupantValid(11);
LastCall.Return(false);
mockDatabase.getRoomOccupant(24);
LastCall.Return(roomOccupant);
}
var target = new Hotel(10);
target.Database = mockDatabase;
String result;
result = target.getRoomOccupantWithCheck(24);
Assert.AreEqual(roomOccupant, result);
result = target.getRoomOccupantWithCheck(11);
Assert.AreEqual("check failed", result);
mocks.VerifyAll();
}
开发者ID:Watersdr,项目名称:Lab2-watersdr,代码行数:24,代码来源:HotelTest.cs
示例9: IntegrationTestDuplicates
public void IntegrationTestDuplicates()
{
SqlConnection sqlConn = new SqlConnection("Server=titan.cs.rose-hulman.edu;Database=csse376_36;User Id=csse376;Password=csse376;");
sqlConn.Open();
ExecuteSQLFile("EmptyAllTables.sql", sqlConn);
Hotel h1 = new Hotel(3);
Assert.IsFalse(h1.IsAlreadyInDB(sqlConn));
h1.WriteToDB(sqlConn);
Hotel h2 = new Hotel(3);
Assert.IsTrue(h2.IsAlreadyInDB(sqlConn));
Car c1 = new Car(1);
Assert.IsFalse(c1.IsAlreadyInDB(sqlConn));
c1.WriteToDB(sqlConn);
Car c2 = new Car(1);
Assert.IsTrue(c2.IsAlreadyInDB(sqlConn));
Flight f1 = new Flight(Flight.FromUnixTime(1401283755), Flight.FromUnixTime(1401944806), 2939);
Assert.IsFalse(f1.IsAlreadyInDB(sqlConn));
f1.WriteToDB(sqlConn);
Flight f2 = new Flight(Flight.FromUnixTime(1401283755), Flight.FromUnixTime(1401944806), 2939);
Assert.IsTrue(f2.IsAlreadyInDB(sqlConn));
}
开发者ID:CSSE376,项目名称:savagejs,代码行数:24,代码来源:IntegrationTests.cs
示例10: SetUp
public void SetUp()
{
targetCar = new Car(DaysToRentCar);
targetFlight = new Flight(StartDate, EndDate, 0);
targetHotel = new Hotel(NightsToRentHotel);
}
开发者ID:henderea,项目名称:Lab4-henderea,代码行数:6,代码来源:BookingTest.cs
示例11: TestThatUpdateOccupandDBIsCalled
public void TestThatUpdateOccupandDBIsCalled()
{
IDatabase stubDatabase = mocks.Stub<IDatabase>();
IUpaderService mockService = mocks.DynamicMock<IUpaderService>();
using (mocks.Record())
{
stubDatabase.isRoomOccupantValid(24);
LastCall.Return(false);
stubDatabase.isRoomOccupantValid(15);
LastCall.Return(true);
}
var target = new Hotel(10);
target.Database = stubDatabase;
target.updateIfInvalid(24, mockService);
target.updateIfInvalid(15, mockService);
mocks.VerifyAll();
}
开发者ID:Watersdr,项目名称:Lab2-watersdr,代码行数:21,代码来源:HotelTest.cs
示例12: TestHotelEqualsTrue
public void TestHotelEqualsTrue()
{
var target = new Hotel(NightsToRentHotel);
var target2 = new Hotel(NightsToRentHotel);
Assert.True(target.Equals(target2));
}
开发者ID:KimberlyBoucher,项目名称:Lab2-boucheka,代码行数:6,代码来源:HotelTest.cs
示例13: TestThatHotelHasCorrectBasePriceForTenDaysStay
public void TestThatHotelHasCorrectBasePriceForTenDaysStay()
{
var target = new Hotel(10);
Assert.AreEqual(450, target.getBasePrice());
}
开发者ID:krenztr,项目名称:Lab4-krenztr,代码行数:5,代码来源:HotelTest.cs
示例14: TestThatHotelInitializes
public void TestThatHotelInitializes()
{
var target = new Hotel(NightsToRentHotel);
Assert.IsNotNull(target);
}
开发者ID:SoggyNoose,项目名称:Lab3-kimsj,代码行数:5,代码来源:HotelTest.cs
示例15: TestHotelNotEqualToOtherObject
public void TestHotelNotEqualToOtherObject()
{
var h1 = new Hotel(10);
var o2 = new Object();
Assert.AreNotEqual(h1, o2);
}
开发者ID:CSSE376,项目名称:savagejs,代码行数:6,代码来源:HotelTest.cs
示例16: SetUp
public void SetUp()
{
targetHotel = new Hotel(NightsToRentHotel);
mocks = new MockRepository();
}
开发者ID:krenztr,项目名称:Lab4-krenztr,代码行数:5,代码来源:HotelTest.cs
示例17: TestThatFlightEqualsReturnsFalseOnObjectOtherThanFlight
public void TestThatFlightEqualsReturnsFalseOnObjectOtherThanFlight()
{
var target = new Flight(startDate, endDate, 1001);
var hotel = new Hotel(10);
Assert.False(target.Equals(hotel));
}
开发者ID:bellrj,项目名称:Lab3-bellrj,代码行数:6,代码来源:FlightTest.cs
示例18: TestThatHotelHasCorrectBasePriceForOneDayStay
public void TestThatHotelHasCorrectBasePriceForOneDayStay()
{
var target = new Hotel(1);
Assert.AreEqual(45, target.getBasePrice());
}
开发者ID:krenztr,项目名称:Lab4-krenztr,代码行数:5,代码来源:HotelTest.cs
示例19: Equals
private bool Equals(Hotel obj)
{
return obj.numberOfNightsToRent.Equals(this.numberOfNightsToRent);
}
开发者ID:Watersdr,项目名称:Lab2-watersdr,代码行数:4,代码来源:Hotel.cs
示例20: TestThatHotelHasCorrectBasePriceForTwoDayStay
public void TestThatHotelHasCorrectBasePriceForTwoDayStay()
{
var target = new Hotel(2);
Assert.AreEqual(90, target.getBasePrice());
}
开发者ID:krenztr,项目名称:Lab4-krenztr,代码行数:5,代码来源:HotelTest.cs
注:本文中的Expedia.Hotel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论