public void ShouldSetIdWhenSetId()
        {
            Part testPart = new Part("Sruba", 3.0, 1);
            testPart.SetId(90);

            Assert.IsTrue(testPart.ID == 90);
        }
        public void ShouldReturnTrueWhenPartsAreEqual()
        {
            Part part = new Part("Kierownica", 24.0, 1);
            Part newPart = new Part("Kierownica", 24.0, 1);

            bool partsAreEqual = part.Equals(newPart);

            Assert.IsTrue(partsAreEqual);
        }
 public void AddPartToRequest(Part part)
 {
     ListOfParts.Add(part);
 }
Ejemplo n.º 4
0
 public bool Equals(Part part)
 {
     return (Name == part.Name && Prize == part.Prize);
 }
        public void ShoulAddPartToRequest()
        {
            string model = "Fiat";
            string owner = "Andrzej Miodek";
            string mark = "126p";
            string description = "Wymiana zderzaka";
            List<Part> parts = new List<Part>()
            {
                new Part("Uszczelka", 40),
                new Part("Kierownica", 400),
                new Part("Opona", 600)
            };

            Part partToAdd = new Part("Migacz", 24.0);

            Request testRequest = new Request(model, owner, mark, description, parts, true);

            testRequest.AddPartToRequest(partToAdd);

            bool partsListContainsAddedPart = testRequest.ListOfParts.Contains(partToAdd);

            Assert.IsTrue(partsListContainsAddedPart);
        }
Ejemplo n.º 6
0
 public bool Equals(Part part)
 {
     return(Name == part.Name && Prize == part.Prize);
 }