public void TestThatMapDataMapsDataIntoProxy() { ITranslationInfoProxy sut = CreateSut(); Assert.That(sut, Is.Not.Null); Guid translationInfoIdentifier = Guid.NewGuid(); string cultureName = CultureInfo.CurrentCulture.Name; MySqlDataReader dataReader = CreateMySqlDataReader(translationInfoIdentifier, cultureName); sut.MapData(dataReader, CreateFoodWasteDataProvider()); Assert.That(sut.Identifier, Is.Not.Null); Assert.That(sut.Identifier, Is.EqualTo(translationInfoIdentifier)); Assert.That(sut.CultureName, Is.Not.Null); Assert.That(sut.CultureName, Is.Not.Empty); Assert.That(sut.CultureName, Is.EqualTo(cultureName)); Assert.That(sut.CultureInfo, Is.Not.Null); Assert.That(sut.CultureInfo.Name, Is.Not.Null); Assert.That(sut.CultureInfo.Name, Is.Not.Empty); Assert.That(sut.CultureInfo.Name, Is.EqualTo(cultureName)); dataReader.AssertWasCalled(m => m.GetString("TranslationInfoIdentifier"), opt => opt.Repeat.Once()); dataReader.AssertWasCalled(m => m.GetString("CultureName"), opt => opt.Repeat.Once()); }
public void TestThatMapDataThrowsArgumentNullExceptionIfDataReaderIsNull() { ITranslationInfoProxy sut = CreateSut(); Assert.That(sut, Is.Not.Null); ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.MapData(null, CreateFoodWasteDataProvider())); TestHelper.AssertArgumentNullExceptionIsValid(result, "dataReader"); }