public void TestSupplierConstructorValidData() { string name = "gert"; string note = "total fed note"; SupplierType type = SupplierType.Cruise; DataAccessFacadeStub stub = new DataAccessFacadeStub(); SupplierEntity entity = new SupplierEntity(type, note, name); Supplier supplier = new Supplier(stub, entity); string expectedName = "gert"; string expectedNote = "total fed note"; SupplierType expectedType = SupplierType.Cruise; Assert.AreEqual(expectedNote, supplier.Note); Assert.AreEqual(expectedName, supplier.Name); Assert.AreEqual(expectedType, supplier.Type); }
public void TestNameEmptyString() { string name = ""; string note = "total fed note"; SupplierType type = SupplierType.Cruise; DataAccessFacadeStub stub = new DataAccessFacadeStub(); bool caughtException = false; try { Supplier supplier = new Supplier(name, note, type, stub); } catch (ArgumentOutOfRangeException) { caughtException = true; } Assert.AreEqual(true, caughtException); }