public async Task TranslateTypedCollection_Empty_Translated() { var translator = new AsyncTranslator(); var to = await translator.TranslateCollection <List <TranslateTo>, TranslateFrom, TranslateTo>( new TranslateFrom[0]); Assert.IsType <List <TranslateTo> >(to); Assert.Equal(0, to.Count); }
public async Task TranslateTypedCollection_ToNewObject_Translated() { var translator = new AsyncTranslator(); var to = await translator.TranslateCollection <List <TranslateTo>, TranslateFrom, TranslateTo>( new TranslateFrom[] { new TranslateFrom() { Property = 1 }, new TranslateFrom() { Property = 2 } }); Assert.IsType <List <TranslateTo> >(to); Assert.Equal(2, to.Count); Assert.Equal(1, to[0].Property); Assert.Equal(2, to[1].Property); }