public SendWelcomeEmail ( string message ) : string | ||
message | string | |
return | string |
public string SayHello() { vendor.SendWelcomeEmail("Message from Product"); var emailservice = new EmailService(); emailservice.SendMessage("New Product", this.Name, "*****@*****.**"); var loggingService = LogAction("Saying hello"); return($"Hello {Name} ({Id}): {Description}. " + $"Available on: {AvailabilityDate?.ToShortDateString()}"); }
public void SendWelcomeEmail_NullCompany_Success() { // Arrange var vendor = new Vendor(); vendor.CompanyName = null; var expected = "Message sent: Hello"; // Act var actual = vendor.SendWelcomeEmail("Test Message"); // Assert Assert.AreEqual(expected, actual); }
public string SayHello() { var Vendor = new Vendor(); Vendor.SendWelcomeEmail("Hi"); var emailService = new EmailService(); var confirmation = emailService.SendMessage("new product", this.ProductName, "recipient"); var result = LogAction("Log hello"); return("Hello " + ProductName + " (" + ProductId + "): " + Description); }
/// <summary> /// Basic Methode to test the class /// </summary> /// <returns></returns> public string SayHello() { //when a instance is only needded once, instantiate the instanstance in the methode var vendor = new Vendor(); vendor.SendWelcomeEmail("Message from Acme.com"); var emailService = new EmailService(); var confirmation = emailService.SendMessage("New Product", this.ProductName, "*****@*****.**"); var result = LogAction("The result is logged"); return("Hello " + ProductName + " (" + ProductId + "): " + ProductDescription + ", Available on: " + AvailabilityDate?.ToShortDateString()); }
public string SayHello() { var vendor = new Vendor(); vendor.SendWelcomeEmail("Message from Product"); var emailService = new EmailService(); emailService.SendMessage("New Product", this.ProductName, "*****@*****.**"); var result = LogAction("Product SayHello"); return("Hello " + ProductName + " (" + ProductId + "): " + Description + " Available on: " + AvailabilityDate?.ToShortDateString()); }
public string productCode => $"{this.Category}-{this.sequencenumber:0000}"; //String interpolation replaces above code -C# 6 public string SayHelloTest() { var vendor = new Vendor(); vendor.SendWelcomeEmail("welcome to the email"); var emailservice = new EmailService(); emailservice.SendMessage("test message", this.productName, "*****@*****.**"); //c# 6 , we can import statis classes, using static Acme.Common.LoggingService; var result = LoggingService.LogAction("Say hello"); return("This is a test for PropertyID " + PropertyId.ToString() + "Product Avaialble on" + AvailabilityDate?.ToShortDateString()); }
public string SayHello() { // access a class within this component var vendor = new Vendor(); vendor.SendWelcomeEmail("Message from Product."); // access a class in a different component var confirmation = new EmailService(); confirmation.SendMessage("New Product", this.ProductName, "*****@*****.**"); // access a static class var log = LoggingService.LogAction("Saying hello"); return($"Hello {ProductName} ({ProductId}): {Description}"); }
public string SayHello() { var vendor = new Vendor(); vendor.SendWelcomeEmail("Message from SayHello"); var emailService = new EmailService(); var confirmation = emailService.SendMessage("New Product", this.productName, "*****@*****.**"); var result = LogAction("saying Hello"); //this.MinimumPrice = 123m; return("Hello " + ProductName + " (" + ProductId + "): " + Description + " Available on: " + AvailabilityDate?.ToShortDateString()); }
public string SayHello() { var vendor = new Vendor(); vendor.SendWelcomeEmail("Message from Product"); var emailService = new EmailService(); emailService.SendMessage("New Product", this.ProductName, "*****@*****.**"); var result = LogAction("Product SayHello"); return "Hello " + ProductName + " (" + ProductId + "): " + Description + " Available on: " + AvailabilityDate?.ToShortDateString(); }