public void GettingComputerByNullManufacturer_Throws() { manager.AddComputer(first); Assert.Throws <ArgumentNullException>(() => manager.GetComputer(null, "A")); }
public void GetCompTrhow_WhenNull(string a, string b) { Assert.That(() => { computerManager.GetComputer(a, b); }, Throws.ArgumentNullException); }
public void GetComputerThrowsExceptionIfComputerDoesNotExist() { Assert.Throws <ArgumentException>(() => { compManager.GetComputer("TestManufacturer", "TestModel"); }); }
public void GetComputer_ShouldThrowExeption_WhenComputerIsNull() { Assert.Throws <ArgumentException>(() => { manager.GetComputer(computer1.Manufacturer, computer1.Model); }); }
public void GetComputer_WhenGetsComputer() { computerManager.AddComputer(computer); var result = computerManager.GetComputer(initialManufacturer, initialModel); Assert.AreEqual(result, computer); }
public void Test_GetComputerReturnsExceptionWithFirstFieldNull() { computerMenager.AddComputer(computer); Assert.That(() => computerMenager.GetComputer(null, "Gosho"), Throws.ArgumentNullException); }
public void GetComputerShouldThrowArgumenExceptionIfCOmputerDoesntExist() { Computer computer = new Computer("HP", "Device200", 700); this.computerManager.AddComputer(computer); Assert.Throws <ArgumentException>(() => computerManager.GetComputer("Lenovo", "2030")); }
public void GetComputerShouldThrowExceptionOnInvalidData() { ComputerManager manager = new ComputerManager(); Assert.Throws <ArgumentNullException>(() => manager.GetComputer("HP", null)); Assert.Throws <ArgumentNullException>(() => manager.GetComputer(null, "HP")); Assert.Throws <ArgumentException>(() => manager.GetComputer("HP", "HP")); }
public void GetComputerShouldReturnProperly() { this.pcMan.AddComputer(this.computer); Computer actual = pcMan.GetComputer("Test", "TestModel"); Assert.AreSame(this.computer, actual); }
public void GetComputerShouldThrowExceptionOnInvalidData() { var computerManager = new ComputerManager(); Assert.Throws <ArgumentNullException>(() => computerManager.GetComputer("Test", null)); Assert.Throws <ArgumentNullException>(() => computerManager.GetComputer(null, "Test")); Assert.Throws <ArgumentException>(() => computerManager.GetComputer("Test", "test")); }
public void GetComputerWorksCorrectly() { manager.AddComputer(computerOne); manager.AddComputer(computerTwo); var computer = manager.GetComputer(computerOne.Manufacturer, computerOne.Model); Assert.That(computer, Is.EqualTo(computerOne)); }
public void ValidateNullValueMethodShouldThrowExceptionWhenObjectIsNull() { Computer nullPC = null; Computer nullPC2 = new Computer(null, "Vostro", 1199.99m); Assert.Throws <ArgumentNullException>(() => pcMngr.AddComputer(nullPC)); Assert.Throws <ArgumentNullException>(() => pcMngr.GetComputer(null, "Vostro")); Assert.Throws <ArgumentNullException>(() => pcMngr.GetComputer("Vostro", null)); }
public void RemoveComputer_ShouldWorksCorrectlyGetComputer() { var comp = new Computer("HP", "Laptop", 1200.0m); computerManager.AddComputer(comp); var getComp = computerManager.GetComputer("HP", "Laptop"); Assert.That(comp, Is.EqualTo(getComp)); }
public void GetCompShlothrExcp() { ComputerManager manager = new ComputerManager(); Assert.Throws <ArgumentNullException>(() => manager.GetComputer(null, "DJONI")); Assert.Throws <ArgumentNullException>(() => manager.GetComputer("DJONI", null)); Assert.Throws <ArgumentException>(() => manager.GetComputer("ZaZA", "bOBI")); }
public void GetComputer_WithInvalidArguments() { computerManager.AddComputer(computer); Exception ex = Assert.Throws <ArgumentException>(() => { computerManager.GetComputer("HP", "something"); }); Assert.AreEqual(ex.Message, "There is no computer with this manufacturer and model."); }
public void GetComputer_NullManufactureThrowException() { Computer computerRemove = new Computer(manufacture, model, price); computerManager.AddComputer(computerRemove); Computer computer2 = new Computer("Laptop", "Hp", 2000); computerManager.AddComputer(computer2); Assert.Throws <ArgumentNullException>(() => computerManager.GetComputer(null, model)); Assert.That(() => computerManager.GetComputer(null, model), Throws.ArgumentNullException.With.Message.EqualTo("Can not be null! (Parameter 'manufacturer')")); }
public void GetComputer_ShouldThrow_WhenComputerDataIsInvalid(string manufacturer, string model, decimal price) { // arrange var computerManager = new ComputerManager(); var computer = new Computer(manufacturer, model, price); // act, assert computerManager.AddComputer(computer); Assert.Throws <ArgumentNullException>(() => computerManager.GetComputer(null, "none")); Assert.Throws <ArgumentNullException>(() => computerManager.GetComputer("another", null)); }
public void GetComputer_ShouldThrowException_WhenInvalidArgumentsAreGiven() { //Arrange ComputerManager computerManager = new ComputerManager(); // Act - Assert Assert.Throws <ArgumentNullException> (() => computerManager.GetComputer("Test", null)); Assert.Throws <ArgumentNullException> (() => computerManager.GetComputer(null, "Test")); Assert.Throws <ArgumentException>(() => computerManager.RemoveComputer("Test", "Test")); }
public void GetComputer_Should_ReturnComputer() { cm.AddComputer(twoThousand); cm.AddComputer(threeThousand); cm.AddComputer(fourThousand); Computer testComputer = twoThousand; Computer returnedComputer = cm.GetComputer("Asus", "ROG2000"); Assert.AreEqual(testComputer.Manufacturer, returnedComputer.Manufacturer); Assert.AreEqual(testComputer.Model, returnedComputer.Model); Assert.AreEqual(testComputer.Price, returnedComputer.Price); }
public void GetComputerIsWorkingProperly() { Computer computer = new Computer("Dawe", "Turbo", 44); Computer computer2 = new Computer("Op", "Mashina", 55); cm.AddComputer(computer2); cm.AddComputer(computer); var expected = computer; var actual = cm.GetComputer("Dawe", "Turbo"); Assert.AreSame(expected, actual); }
public void Test4() { ComputerManager computerManager = new ComputerManager(); Assert.Throws <ArgumentNullException>(() => computerManager.GetComputer("njksa", null)); }
public void Test17() { Computer computer = new Computer("name", "model", 1.23m); ComputerManager computerManager = new ComputerManager(); Assert.Throws <ArgumentException>(() => computerManager.GetComputer("name", "nakjda")); }
public void Get_Computers__Method_Should_Throw_An_Exception_If_The_Model_Is_Null() { var computerManager = new ComputerManager(); Assert.Throws <ArgumentNullException>( () => computerManager.GetComputer("10", null), "Value is not null."); }
public void Test3() { Computer computer = new Computer("name", "model", 1.23m); ComputerManager computerManager = new ComputerManager(); Assert.Throws <ArgumentNullException>(() => computerManager.GetComputer("njksa", null)); }
public void Get_Computer_Method_Should_Throw_An_Exception_If_Computer_Is_Null() { var computerManager = new ComputerManager(); Assert.Throws <ArgumentException>( () => computerManager.GetComputer("1", "1"), "This computer is not null."); }
public void IsInGetComputerItemWeLookedForDoesNotExist() { Computer comp = new Computer("Apple", "MacBook", 1550.50M); ComputerManager manager = new ComputerManager(); manager.AddComputer(comp); Assert.Throws <ArgumentException>(() => manager.GetComputer("Apple12", "MacBook15")); }
public void GetComputerShouldWorkAsExpected() { ComputerManager manager = new ComputerManager(); Computer computer1 = new Computer("HP", "HP", 1000); manager.AddComputer(computer1); var computerFromComputerManager = manager.GetComputer("HP", "HP"); Assert.AreEqual(computer1, computerFromComputerManager); }
public void ComputerManagerGetMethodReturn() { ComputerManager compMan = new ComputerManager(); Computer comp = new Computer("DC", "A", (decimal)5.5); compMan.AddComputer(comp); Computer compRemoved = compMan.GetComputer("DC", "A"); Assert.That(compRemoved, Is.EqualTo(compRemoved)); }
public void GetComputerModelCanNotBeNull() { Computer comp = new Computer("Apple", "MacBook", 1550.50M); ComputerManager manager = new ComputerManager(); manager.AddComputer(comp); Assert.Throws <ArgumentNullException>(() => manager.GetComputer("Apple", null)); }
public void IsGetComputerMethodReturnsCorrectComp() { Computer comp = new Computer("Apple", "MacBook", 1550.50M); ComputerManager manager = new ComputerManager(); manager.AddComputer(comp); Assert.AreEqual(comp, manager.GetComputer("Apple", "MacBook")); }