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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }