public void throws_exception_when_removing_last_primary_language() { var subject = new Provider() { Id = 1 }; var english = new Language(false, 1, "English", true); var spanish = new Language(false, 2, "Spanish", true); subject.AddLanguage(english); subject.AddLanguage(spanish); subject.RemoveLanguage(english); }
public void throws_exception_when_removing_null_language() { var subject = new Provider() { Id = 1 }; subject.RemoveLanguage(null); }
public void can_remove_nonprimary_language() { var subject = new Provider() { Id = 1}; var firstLanguage = new Language(false, 1, "English", true); var secondLanguage = new Language(false, 2, "Spanish", true); subject.AddLanguage(firstLanguage); subject.AddLanguage(secondLanguage); var removed = subject.RemoveLanguage(secondLanguage); Assert.AreEqual(secondLanguage, removed.Language); Assert.IsTrue(subject.ProviderLanguages.Count == 1); }