public void Test_Whether_AddMethod_Throws_Exception_When_Astronaut_Already_Exists() { spaceship.Add(this.astronaut); var anotherAstronaut = new Astronaut("Grisho", 45); Assert.Throws <InvalidOperationException>(() => spaceship.Add(anotherAstronaut)); }
public void AddAStro_ShouldThrowExcCapacity() { Spaceship space = new Spaceship("pesho", 1); space.Add(new Astronaut("gosho", 25)); Assert.Throws <InvalidOperationException>(() => space.Add(new Astronaut("pesho", 15))); }
public void TestAddThrowsWithExistingAstronaut() { Spaceship space1 = new Spaceship("Zero", 5); space1.Add(astronaut); Assert.Throws <InvalidOperationException>(() => space1.Add(astronaut)); }
public void TestAddThrowsWithFullCapacity() { Spaceship space1 = new Spaceship("Zero", 1); space1.Add(astronaut); Assert.Throws <InvalidOperationException>(() => space1.Add(new Astronaut("Gosho", 50))); }
public void AddAstronaut_ThrowsException_WhenCapacityIsEcxeeded() { var spaceship = new Spaceship("aa", 1); spaceship.Add(new Astronaut("bb", 11.1)); Assert.Throws <InvalidOperationException>(() => spaceship.Add(new Astronaut("vv", 2.2))); }
public void ThrowsExceptionWhenAddNewAstronautAndSameNameAlreadyExists() { Spaceship spaceship = new Spaceship("Universe", 5); spaceship.Add(new Astronaut("Rus", 100)); Assert.Throws <InvalidOperationException>(() => spaceship.Add(new Astronaut("Rus", 44.5)), "Astronaut Rus is already in!"); }
public void AddMethod_WithoutCapacity_Should_ThrowExcepiton() { var spaceship = new Spaceship("Name One", 1); spaceship.Add(new Astronaut("One", 10)); Assert.Throws <InvalidOperationException>(() => spaceship.Add(new Astronaut("Two", 10))); }
public void AddMethod_AlreadyExistAustorinauth_Should_ThrowExcepiton() { var spaceship = new Spaceship("Name One", 10); spaceship.Add(new Astronaut("One", 10)); Assert.Throws <InvalidOperationException>(() => spaceship.Add(new Astronaut("One", 10))); }
public void Test_AddExistingAstronaut_Throws() { var spaceship = new Spaceship("Apolo", 2); spaceship.Add(new Astronaut("Pesho", 100)); Assert.Throws <InvalidOperationException>(() => spaceship.Add(new Astronaut("Pesho", 100))); }
public void CheckCapacityForAstronautDuplicationException() { var spaceship = new Spaceship("zaza", 7); spaceship.Add(new Astronaut("gogo", 4)); Assert.Throws <InvalidOperationException>(() => spaceship.Add(new Astronaut("gogo", 5))); }
public void Test_AddWithFullCapacity_Throws() { var spaceship = new Spaceship("Apolo", 1); spaceship.Add(new Astronaut("Pesho", 100)); Assert.Throws <InvalidOperationException>(() => spaceship.Add(new Astronaut("Gosho", 100))); }
public void TestAddThrows() { spaceship.Add(astronaut); Astronaut secondAst = new Astronaut("Pesho", 20); Assert.Throws <InvalidOperationException>(() => this.spaceship.Add(secondAst)); }
public void AddMethodShouldThrowInvalidOperationExceptionIfSpaceshipContainsAstronautWithThisName() { Spaceship spaceship = new Spaceship("Test", 2); spaceship.Add(new Astronaut("Ivan", 40)); Assert.Throws <InvalidOperationException>((() => spaceship.Add(new Astronaut("Ivan", 50)))); }
public void AddMethodShouldThrowInvalidOperationExceptionIfCapacityIsFull() { Spaceship spaceship = new Spaceship("Test", 1); spaceship.Add(new Astronaut("Ivan", 40)); Assert.Throws <InvalidOperationException>((() => spaceship.Add(new Astronaut("Dimo", 50)))); }
public void ThrowsExceptionWhenAddNewAstronautWhenCapacityIsFull() { Spaceship spaceship = new Spaceship("Universe", 1); spaceship.Add(new Astronaut("Rus", 45.5)); Assert.Throws <InvalidOperationException>(() => spaceship.Add(new Astronaut("Ivan", 33.3)), "Spaceship is full!"); }
public void AddingAstrWorks() { Astronaut astronaut = new Astronaut("fin", 100); spaceship.Add(astronaut); Assert.AreEqual(1, spaceship.Count); }
public void AddAstro_ShouldThrowExcExistAstro() { Spaceship space = new Spaceship("pesho", 1); Astronaut astro = new Astronaut("gosho", 25); space.Add(astro); Assert.Throws <InvalidOperationException>(() => space.Add(astro)); }
public void Add_Astronaut_Work_Correctly() { spaceship.Add(astronaut); spaceship.Add(astronaut2); var count = spaceship.Count; Assert.AreEqual(2, count); }
public void AddingExistindAstronautShouldThrowException() { Spaceship spaceship = new Spaceship("Millennium falcon", 4); spaceship.Add(astronaut); spaceship.Add(astronaut1); Assert.Throws <InvalidOperationException>(() => spaceship.Add(astronaut)); }
public void TestAddingExistingAstronaut() { Spaceship spaceship = new Spaceship("Enterprise", 50); Astronaut astronaut = new Astronaut("Neil", 100); spaceship.Add(astronaut); Assert.Throws <InvalidOperationException>(() => spaceship.Add(astronaut), $"Astronaut {astronaut.Name} is already in!"); }
public void ExistingAstronaut() { Astronaut astronaut1 = new Astronaut("Pesho", 1); spaceship = new Spaceship("Moon", 2); spaceship.Add(astronaut); Assert.Throws <InvalidOperationException>(() => spaceship.Add(astronaut1), $"Astronaut {astronaut1.Name} is already in!"); }
public void TestCount_And_AddRemoveWithValidData() { Assert.AreEqual(0, s.Count); s.Add(a); s.Add(ast); Assert.AreEqual(2, s.Count); s.Remove("Desen"); Assert.AreEqual(1, s.Count); }
public void FullSpaceshipAdd() { Astronaut astronaut1 = new Astronaut("Name", 1); spaceship = new Spaceship("Moon", 1); spaceship.Add(astronaut); Assert.Throws <InvalidOperationException>(() => spaceship.Add(astronaut1), "Spaceship is full!"); }
public void AddAstronaut_ThrowsException_WhenAddingSameAstronaut() { var spaceship = new Spaceship("aa", 1); var astronaut = new Astronaut("bb", 11.1); spaceship.Add(astronaut); Assert.Throws <InvalidOperationException>(() => spaceship.Add(astronaut)); }
public void AddAstronautWhoIsAlredyInSpaceship() { Spaceship spaceship = new Spaceship("Hi", 3); Astronaut astronaut1 = new Astronaut("Gosho", 25); spaceship.Add(astronaut1); Assert.That(() => spaceship.Add(astronaut1), Throws.InvalidOperationException.With.Message.EqualTo($"Astronaut {astronaut1.Name} is already in!")); }
public void TestAddingWithFullCapacity() { Spaceship spaceship = new Spaceship("Enterprise", 1); Astronaut astronaut = new Astronaut("Neil", 100); Astronaut newAstronaut = new Astronaut("Armstrong", 100); spaceship.Add(astronaut); Assert.Throws <InvalidOperationException>(() => spaceship.Add(newAstronaut), "Spaceship is full!"); }
public void AddAstronautShouldThrowExceptionWithExistingAstronautName() { Astronaut astronaut = new Astronaut("TestName", 21.92); Spaceship spaceship = new Spaceship("Test1", 40); Astronaut newAstronaut = new Astronaut("TestName", 22); spaceship.Add(astronaut); Assert.Throws <InvalidOperationException>(() => spaceship.Add(newAstronaut)); }
public void GetSpaceshipCountShouldBeCorrect() { string name = "Pesho"; double oxygenInPercentage = 20d; Astronaut astronaut = new Astronaut(name, oxygenInPercentage); spaceship.Add(astronaut); Assert.AreEqual(1, spaceship.Count); }
public void CheckRemove() { var spaceship = new Spaceship("zaza", 7); spaceship.Add(new Astronaut("gogo", 4)); spaceship.Add(new Astronaut("pipi", 4)); var result = spaceship.Remove("gogo"); Assert.AreEqual(true, result); }
public void AddingWhenFull() { spaceship = new Spaceship("Falc", 1); Astronaut astronaut = new Astronaut("fin", 100); Astronaut astronaut1 = new Astronaut("min", 102); spaceship.Add(astronaut); Assert.Throws <InvalidOperationException>(() => spaceship.Add(astronaut1)); }