本文整理汇总了C#中Statement.GetStatement方法的典型用法代码示例。如果您正苦于以下问题:C# Statement.GetStatement方法的具体用法?C# Statement.GetStatement怎么用?C# Statement.GetStatement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statement
的用法示例。
在下文中一共展示了Statement.GetStatement方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Statement_WhenCustomerHaveNoRentals_ShouldPass
public void Statement_WhenCustomerHaveNoRentals_ShouldPass()
{
const string customerName = "John Rambo";
const double expectedTotalAmount = 0;
const int expectedFrequentRenterPoints = 0;
var customer = new Customer(customerName);
var statement = new Statement(customer);
Assert.True(CheckStatement(statement, new Dictionary<string, double>(), customerName, expectedTotalAmount, expectedFrequentRenterPoints));
Assert.True(CheckStringStatement(statement.GetStatement(new StringStatement()), new Dictionary<string, double>(), customerName, expectedTotalAmount, expectedFrequentRenterPoints));
Assert.True(CheckJsonStatement(statement.GetStatement(new JsonStatement()), new Dictionary<string, double>(), customerName, expectedTotalAmount, expectedFrequentRenterPoints));
}
示例2: Statement_WhenCustomerHaveSingleRental_Shouldpass
public void Statement_WhenCustomerHaveSingleRental_Shouldpass()
{
const string customerName = "John Rambo";
const int daysRented = 3;
const double expectedTotalAmount = 9;
const int expectedFrequentRenterPoints = 2;
var movie = new Movie { PriceCode = TypeOfMovie.NewRelease, Title = "Rembo : XX" };
var customerRentals = new Rental[1];
customerRentals[0] = new Rental(movie, daysRented);
var customer = new Customer(customerName, new Rental(movie, daysRented));
var statement = new Statement(customer);
Assert.True(CheckStatement(statement, GetMoviesWithPrice(customerRentals), customerName, expectedTotalAmount, expectedFrequentRenterPoints));
Assert.True(CheckStringStatement(statement.GetStatement(new StringStatement()), GetMoviesWithPrice(customerRentals), customerName, expectedTotalAmount, expectedFrequentRenterPoints));
Assert.True(CheckJsonStatement(statement.GetStatement(new JsonStatement()), GetMoviesWithPrice(customerRentals), customerName, expectedTotalAmount, expectedFrequentRenterPoints));
}
示例3: Statement__WhenCustomerHaveMultipleRentals_Shouldpass
public void Statement__WhenCustomerHaveMultipleRentals_Shouldpass(int regularMovieDays, int childrensMovieDays, int newReleaseMovieDays,
double expectedTotalAmount, int expectedFrequentRenterPoints)
{
const string customerName = "John Rambo";
var newReleaseMovie = new Movie { PriceCode = TypeOfMovie.NewRelease, Title = "Rembo : XX" };
var regularMovie = new Movie { PriceCode = TypeOfMovie.Regular, Title = "Rembo :First Blood" };
var childrensMovie = new Movie { PriceCode = TypeOfMovie.Childrens, Title = "Rembo : Baby edition" };
var customerRentals = new[]
{
new Rental(regularMovie, regularMovieDays),
new Rental(childrensMovie, childrensMovieDays),
new Rental(newReleaseMovie, newReleaseMovieDays)
};
var customer = new Customer(customerName, customerRentals);
var statement = new Statement(customer);
Assert.True(CheckStatement(statement, GetMoviesWithPrice(customerRentals), customerName, expectedTotalAmount, expectedFrequentRenterPoints));
Assert.True(CheckStringStatement(statement.GetStatement(new StringStatement()), GetMoviesWithPrice(customerRentals), customerName, expectedTotalAmount, expectedFrequentRenterPoints));
Assert.True(CheckJsonStatement(statement.GetStatement(new JsonStatement()), GetMoviesWithPrice(customerRentals), customerName, expectedTotalAmount, expectedFrequentRenterPoints));
}