Click here to Skip to main content
14,430,378 members
   

C#

 
GeneralRe: Tracking Data Changes Pin
Kevin Marois13-Dec-19 12:43
professionalKevin Marois13-Dec-19 12:43 
AnswerRe: Tracking Data Changes Pin
Gerry Schmitz13-Dec-19 13:38
mveGerry Schmitz13-Dec-19 13:38 
GeneralRe: Tracking Data Changes Pin
Kevin Marois16-Dec-19 11:51
professionalKevin Marois16-Dec-19 11:51 
GeneralRe: Tracking Data Changes Pin
Gerry Schmitz16-Dec-19 13:06
mveGerry Schmitz16-Dec-19 13:06 
QuestionHow do you make a unit test of an empty linked list? Pin
Melissa Anthonia13-Dec-19 8:56
MemberMelissa Anthonia13-Dec-19 8:56 
AnswerRe: How do you make a unit test of an empty linked list? Pin
Melissa Anthonia13-Dec-19 10:13
MemberMelissa Anthonia13-Dec-19 10:13 
GeneralRe: How do you make a unit test of an empty linked list? Pin
Gerry Schmitz13-Dec-19 13:49
mveGerry Schmitz13-Dec-19 13:49 
GeneralRe: How do you make a unit test of an empty linked list? Pin
Melissa Anthonia13-Dec-19 14:45
MemberMelissa Anthonia13-Dec-19 14:45 
I have tried this method, but when writing
List<string> list = new List<string>();
I do not get the option to refer to the class in my other cs file.
Remember, I have two files here: Program.cs and UnitTest1.cs.

This is why this one is so confusing to me.
For example, if I had a ordinary class with normal strings such as:
public class Car
    {
        private string model;
        private string colour;

        public Car(string model, string colour)
        {
            this.model = model;
            this.colour = colour;
        }

I would just write this in my test:
[TestClass]
   public class CarTestClass
   {
       [TestMethod]
       public void TestCar()
       {
           // arrange
           Car mycar = new Car("Renault", "flame red");
           Car myothercar = new Car("Volvo");

           //act
           string mymodel = mycar.Model;
           string mycolour = mycar.Colour;
           string myothermodel = myothercar.Model;
           string myothercolour = myothercar.Colour;

           // assert
           Assert.AreEqual("Renault", mymodel);
           Assert.AreEqual("flame red", mycolour);
           Assert.AreEqual("Volvo", myothermodel);
           Assert.IsNull(myothercolour);
       }


This is the method I am used to, which is why this list is confusing me.
AnswerRe: How do you make a unit test of an empty linked list? Pin
Melissa Anthonia14-Dec-19 4:14
MemberMelissa Anthonia14-Dec-19 4:14 
Questiondesign a printdocument control with a text and boxes like filling form Pin
bimalachira13-Dec-19 8:06
Memberbimalachira13-Dec-19 8:06 
AnswerRe: design a printdocument control with a text and boxes like filling form Pin
OriginalGriff13-Dec-19 9:03
communityengineerOriginalGriff13-Dec-19 9:03 
Questionc# memory crash Pin
Member 1449096413-Dec-19 6:26
MemberMember 1449096413-Dec-19 6:26 
AnswerRe: c# memory crash Pin
OriginalGriff13-Dec-19 6:42
communityengineerOriginalGriff13-Dec-19 6:42 
GeneralRe: c# memory crash Pin
Member 1449096413-Dec-19 6:57
MemberMember 1449096413-Dec-19 6:57 
AnswerRe: c# memory crash Pin
OriginalGriff13-Dec-19 7:03
communityengineerOriginalGriff13-Dec-19 7:03 
GeneralRe: c# memory crash Pin
Eddy Vluggen13-Dec-19 7:04
professionalEddy Vluggen13-Dec-19 7:04 
GeneralRe: c# memory crash Pin
OriginalGriff13-Dec-19 7:12
communityengineerOriginalGriff13-Dec-19 7:12 
GeneralRe: c# memory crash Pin
Eddy Vluggen13-Dec-19 7:13
professionalEddy Vluggen13-Dec-19 7:13 
GeneralRe: c# memory crash Pin
Eddy Vluggen13-Dec-19 7:13
professionalEddy Vluggen13-Dec-19 7:13 
GeneralRe: c# memory crash Pin
Member 1449096413-Dec-19 7:21
MemberMember 1449096413-Dec-19 7:21 
GeneralRe: c# memory crash Pin
Eddy Vluggen13-Dec-19 7:24
professionalEddy Vluggen13-Dec-19 7:24 
GeneralRe: c# memory crash Pin
Richard Deeming13-Dec-19 7:31
communityengineerRichard Deeming13-Dec-19 7:31 
GeneralRe: c# memory crash Pin
Eddy Vluggen13-Dec-19 8:12
professionalEddy Vluggen13-Dec-19 8:12 
GeneralRe: c# memory crash Pin
Member 1449096413-Dec-19 7:42
MemberMember 1449096413-Dec-19 7:42 
GeneralRe: c# memory crash Pin
Eddy Vluggen13-Dec-19 8:11
professionalEddy Vluggen13-Dec-19 8:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.