Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create an application in C# named TestClassifiedAd that instantiates and display

ID: 3592892 • Letter: C

Question

Create an application in C# named TestClassifiedAd that instantiates and displays a ClassifiedAd object. A ClassifiedAd has fields for a category (for example, Used Cars), a number of words and a price. Include properties that contain get and set accessors for the category and number of words, but only a get accessor for the price. The price is calculated at nine cents per word. Also

Class ClassifiedAd implements:

A constructor which defines two parameters: category and word count

Two read-only auto-implemented properties: category and word count. The constructor assigns values to these two properties

One read-only property, which calculates the price of the classified advertisement

Application class TestClassifiedAd implements one method which defines a parameter of typeClassifiedAd. The method is responsible for displaying the details related to the classified advertisement entered by the user.

Explanation / Answer

public class ApplicationCodeClass { public string combineArrayStringWithSpace(string[] stringArray) { string str = default(string); foreach (string item in stringArray) { str += item + " "; } return str.Trim(); } } /// ///A test for combineArrayStringWithSpace /// [TestMethod()] public void combineArrayStringWithSpaceTest() { ApplicationCodeClass target = new ApplicationCodeClass(); // TODO: Initialize to an appropriate value string[] stringArray = null; // TODO: Initialize to an appropriate value string expected = string.Empty; // TODO: Initialize to an appropriate value string actual; actual = target.combineArrayStringWithSpace(stringArray); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); } [TestMethod] public void PossitiveSchenarioForChecking_combineArrayStringWithSpace() { string expectedResult = "Today is the wonderful day of my life"; string[] actualStringArray = new string[] { "Today", "is", "the", "wonderful", "day", "of", "my", "life" }; ApplicationCodeClass appObject = new ApplicationCodeClass(); string actualResult = appObject.combineArrayStringWithSpace(actualStringArray); Assert.AreEqual(expectedResult, actualResult); }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote