本文整理汇总了C#中Acme.Biz.Product.SayHello方法的典型用法代码示例。如果您正苦于以下问题:C# Product.SayHello方法的具体用法?C# Product.SayHello怎么用?C# Product.SayHello使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acme.Biz.Product
的用法示例。
在下文中一共展示了Product.SayHello方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SayHello_ParameterizedConstructor_Test
public void SayHello_ParameterizedConstructor_Test()
{
//Arrange
var currentProduct = new Product("Honda", 2346, "Nice car from Japan");
var expected = "Hello Honda (2346): Nice car from Japan" + " Available on: ";
//Act
var actual = currentProduct.SayHello();
//Assert
Assert.AreEqual(expected, actual);
}
示例2: SayHello_ParameterizedConstructor
public void SayHello_ParameterizedConstructor()
{
//Arrange
var currentProduct = new Product(1, "Saw",
"15-inch steel blade hand saw");
var expected = "Hello Saw (1): 15-inch steel blade hand saw";
//Act
var actual = currentProduct.SayHello();
//Assert
Assert.AreEqual(expected, actual);
}
示例3: SayHello_ParamterizedConstructor
public void SayHello_ParamterizedConstructor()
{
//Arrange
var currentProduct = new Product(1, "Hammer", "A sturdy tool");
var expected = "Hello Hammer (1): A sturdy tool" +
" Available on: ";
//Act
var actual = currentProduct.SayHello();
//Assert
Assert.AreEqual(expected, actual);
}
示例4: SayHelloTest
public void SayHelloTest()
{
//Arrange
var currentProduct = new Product();
currentProduct.ProductName = "Saw";
currentProduct.ProductId = 1;
currentProduct.Description = "15-inch steel blade hand saw";
var expected = "Hello Saw (1): 15-inch steel blade hand saw";
//Act
var actual = currentProduct.SayHello();
//Assert
Assert.AreEqual(expected, actual);
}
示例5: SayHello_ParameterizedConstructorTest
public void SayHello_ParameterizedConstructorTest()
{
//Arrage
var currentProduct = new Product(1,"Saw", "Steel Blade hand saw");
//currentProduct.ProductId = 1;
//currentProduct.ProductName = "Saw";
//currentProduct.Description = "Steel Blade hand saw";
var expectedMessage = "Hello Saw (1) Steel Blade hand saw";
//Act
Console.WriteLine("Current Product" + currentProduct.ProductName);
var actual = currentProduct.SayHello();
//Assert
Assert.AreEqual(expectedMessage, actual);
}
示例6: SayHelloParmTest
public void SayHelloParmTest()
{
//arrange
var currentProduct = new Product(1, "Saw", "15-inch steel blade hand saw");
var expected = "Hello Saw (1) 15-inch steel blade hand saw" +
" Available on: ";
//act
var actual = currentProduct.SayHello();
//assert
Assert.AreEqual(expected, actual);
}
示例7: SayHelloTest
public void SayHelloTest()
{
//Arrange
var currentProduct = new Product();
currentProduct.ProductName = "Honda";
currentProduct.ProductId = 2346;
currentProduct.Description = "Nice car from Japan";
currentProduct.ProductVendor.CompanyName = "Honda Ltd.";
var expected = "Hello Honda (2346): Nice car from Japan" + " Available on: ";
//Act
var actual = currentProduct.SayHello();
//Assert
Assert.AreEqual(expected, actual);
}
示例8: SayHelloTest
public void SayHelloTest()
{
//Arrage
var currentProduct = new Product();
currentProduct.ProductId = 1;
currentProduct.ProductName = "Saw";
currentProduct.Description = "Steel Blade hand saw";
currentProduct.ProductVendor.CompanyName = "ABC Ltd";
var expectedMessage = "Hello Saw (1) Steel Blade hand saw";
//Act
var actual = currentProduct.SayHello();
//Assert
Assert.AreEqual(expectedMessage, actual);
}
示例9: SayHello_ObjectInitializer
public void SayHello_ObjectInitializer()
{
//Arrange
var currentProduct = new Product
{
ProductId = 1,
ProductName = "Saw",
Description = "15-inch steel blade hand saw"
};
var expected = "Hello Saw (1): 15-inch steel blade hand saw";
//Act
var actual = currentProduct.SayHello();
//Assert
Assert.AreEqual(expected, actual);
}
示例10: SayHello_ObjectInitializer
public void SayHello_ObjectInitializer()
{
var currentProduct = new Product
{
ProductId = 1,
ProductName = "Hammer",
Description = "A sturdy tool"
};
var expected = "Hello Hammer (1): A sturdy tool" +
" Available on: ";
//Act
var actual = currentProduct.SayHello();
//Assert
Assert.AreEqual(expected, actual);
}
示例11: SayHelloTest
public void SayHelloTest()
{
//Arrange
var currentProduct = new Product();
currentProduct.ProductId = 1;
currentProduct.ProductName = "Hammer";
currentProduct.Description = "A sturdy tool";
currentProduct.ProductVendor.CompanyName = "XYZ Corporation";
var expected = "Hello Hammer (1): A sturdy tool" +
" Available on: ";
//Act
var actual = currentProduct.SayHello();
//Assert
Assert.AreEqual(expected, actual);
}
示例12: SayHello_ObjectInitializer_Test
public void SayHello_ObjectInitializer_Test()
{
//Arrange
var currentProduct = new Product
{
ProductName = "Honda",
ProductId = 2346,
Description = "Nice car from Japan",
};
var expected = "Hello Honda (2346): Nice car from Japan" + " Available on: ";
//Act
var actual = currentProduct.SayHello();
//Assert
Assert.AreEqual(expected, actual);
}
示例13: SayHelloTest
public void SayHelloTest()
{
//arrange
var currentProduct = new Product
{
ProductName = "Saw",
ProductId = 1,
Description = "15-inch steel blade hand saw"
};
// currentProduct.ProductName = "Saw";
// currentProduct.ProductId = 1;
// currentProduct.Description = "15-inch steel blade hand saw";
currentProduct.ProductVendor.CompanyName = "ABC Company";
var expected = "Hello Saw (1) 15-inch steel blade hand saw" +
" Available on: ";
//act
var actual = currentProduct.SayHello();
// Console.WriteLine(actual);
//assert
Assert.AreEqual(expected, actual);
}
示例14: SayHelloTest
public void SayHelloTest()
{
//Arrange
var currentProduct = new Product
{
ProductName = "Saw",
ProductId = 1,
Description = "15-inch steel blade hand saw",
ProductVendor = {CompanyName = "ABC Corp"}
};
var expected = "Hello Saw (1): 15-inch steel blade hand saw" +
" Available on: ";
//Act
var actual = currentProduct.SayHello();
//Assert
Assert.AreEqual(expected, actual);
}