public void PartsCatalogue_GetCompatibleParts_PartsFound() { //Arrange string partNumber = "1234-Test"; //Act List <PartSummary> result = (List <PartSummary>)_partsCatalogue.GetCompatibleParts(partNumber); //Assert Assert.IsTrue(result.Count > 0); _partsTraderPartsServiceMock.Verify(x => x.FindAllCompatibleParts(partNumber), Times.Once); }
public void GetCompatibleParts_CorrectPartNumberLongPartCode_Pass() { PartCatalogue partCatalogue = new PartCatalogue(); partCatalogue.GetCompatibleParts("1234-aBcDeE12345"); Assert.Pass(); }
public void GetCompatibleParts_CorrectPartNumber_Pass() { PartCatalogue partCatalogue = new PartCatalogue(); partCatalogue.GetCompatibleParts("1234-test"); Assert.Pass(); }
public void ShouldNotHaveItemsInDatabase() { var value = 0; PartCatalogue catalogue = new PartCatalogue(_service); IEnumerable <PartSummary> result = catalogue.GetCompatibleParts("1234-1234abc"); Assert.AreEqual(value, result.Count()); }
public void GetCompatibleParts_PartNumberWithoutDash_ThrowsInvalidPartException() { PartCatalogue partCatalogue = new PartCatalogue(); Assert.Throws <InvalidPartException>(() => { partCatalogue.GetCompatibleParts("1234abcd"); }); }
public void GetCompatibleParts_PartCodeNonAlphanumeric_ThrowsInvalidPartException() { PartCatalogue partCatalogue = new PartCatalogue(); Assert.Throws <InvalidPartException>(() => { partCatalogue.GetCompatibleParts("abcd-a+b*"); }); }
public void GetCompatibleParts_PartIdNonDigit_ThrowsInvalidPartException() { PartCatalogue partCatalogue = new PartCatalogue(); Assert.Throws <InvalidPartException>(() => { partCatalogue.GetCompatibleParts("abcd-abcd"); }); }
public void GetCompatibleParts_PartCodeTooShort_ThrowsInvalidPartException() { PartCatalogue partCatalogue = new PartCatalogue(); Assert.Throws <InvalidPartException>(() => { partCatalogue.GetCompatibleParts("123-abc"); }); }
public void ShouldHaveItemsExclusionList() { var value = 0; PartCatalogue catalogue = new PartCatalogue(_service); IEnumerable <PartSummary> result = catalogue.GetCompatibleParts("1111-Invoice"); Assert.AreEqual(value, result.Count()); }
public void GetCompatibleParts_PartNumberInTheDataList_FindFourCompatibleParts() { //Arrange string partNumber = "5772-MetaDATA"; PartCatalogue partCatalogue = new PartCatalogue(); //Act IEnumerable <PartSummary> compatibleParts = partCatalogue.GetCompatibleParts(partNumber); //Assert Assert.AreEqual(4, compatibleParts.Count <PartSummary>()); }
public void GetCompatibleParts_PartNumberInTheDataList_FindCompatibleParts() { //Arrange string partNumber = "5772-MetaDATA"; PartCatalogue partCatalogue = new PartCatalogue(); //Act IEnumerable <PartSummary> compatibleParts = partCatalogue.GetCompatibleParts(partNumber); PartSummary compatiblePart = compatibleParts.First(x => x.PartNumber == partNumber); //Assert Assert.AreEqual(partNumber, compatiblePart.PartNumber); }
public void GetCompatibleParts_PartNumberInTheExclusionListWithDifferentCase_Empty() { PartCatalogue partCatalogue = new PartCatalogue(); Assert.IsEmpty(partCatalogue.GetCompatibleParts("1234-ABCD")); }