public void TestThatTranslationAddThrowsArgumentNullExceptionWhenTranslationIsNull() { var translatable = new MyTranslatable(); Assert.That(translatable, Is.Not.Null); var exception = Assert.Throws <ArgumentNullException>(() => translatable.TranslationAdd(null)); Assert.That(exception, Is.Not.Null); Assert.That(exception.ParamName, Is.Not.Null); Assert.That(exception.ParamName, Is.Not.Empty); Assert.That(exception.ParamName, Is.EqualTo("translation")); Assert.That(exception.InnerException, Is.Null); }
public void TestThatTranslationAddAddsTranslation() { var identifier = Guid.NewGuid(); var translatable = new MyTranslatable { Identifier = identifier }; Assert.That(translatable, Is.Not.Null); Assert.That(translatable.Translations, Is.Not.Null); Assert.That(translatable.Translations, Is.Empty); var translationMock = DomainObjectMockBuilder.BuildTranslationMock(identifier); translatable.TranslationAdd(translationMock); Assert.That(translatable.Translations, Is.Not.Null); Assert.That(translatable.Translations, Is.Not.Empty); Assert.That(translatable.Translations.Contains(translationMock), Is.True); }