public static void BgRgb_GivenValidColor_ReturnsNewObject() { FabulousText text = string.Empty; var result = Fabulous.BgRgb(12, 34, 56); Assert.AreNotSame(text, result); }
public static void AdditionOp_GivenTextThenCollectionWithNullText_ThrowsArgNullException() { FabulousTextCollection collection = "abc"; FabulousText text = null; Assert.Throws <ArgumentNullException>(() => _ = text + collection); }
public static void BgHex_GivenValidHex_ReturnsNewObject() { FabulousText text = string.Empty; var result = Fabulous.BgHex("#8FBC8F"); Assert.AreNotSame(text, result); }
public static void AdditionOp_GivenCollectionThenTextWithNullCollection_ThrowsArgNullException() { FabulousTextCollection collection = null; FabulousText text = "abc"; Assert.Throws <ArgumentNullException>(() => _ = collection + text); }
public static void BgKeyword_GivenValidColorNameEnum_ReturnsNewObject() { FabulousText text = string.Empty; var result = Fabulous.BgKeyword(ColorKeyword.DarkSeaGreen); Assert.AreNotSame(text, result); }
public static void BgBlack_PropertyGet_ReturnsNewObject() { FabulousText text = string.Empty; var result = text.BgBlack; Assert.AreNotSame(text, result); }
public static void Strikethrough_PropertyGet_ReturnsNewObject() { FabulousText text = string.Empty; var result = text.Strikethrough; Assert.AreNotSame(text, result); }
public static void Underline_PropertyGet_ReturnsNewObject() { FabulousText text = string.Empty; var result = text.Underline; Assert.AreNotSame(text, result); }
public static void Keyword_GivenInvalidKeywordEnum_ThrowsArgNullException() { FabulousText text = string.Empty; const ColorKeyword keyword = (ColorKeyword)293048; Assert.Throws <ArgumentException>(() => text.Keyword(keyword)); }
public static void WhiteBright_PropertyGet_ReturnsNewObject() { FabulousText text = string.Empty; var result = text.WhiteBright; Assert.AreNotSame(text, result); }
public static void Cyan_PropertyGet_ReturnsNewObject() { FabulousText text = string.Empty; var result = Fabulous.Cyan; Assert.AreNotSame(text, result); }
public static void Grey_PropertyGet_ReturnsObjectWithGreyForegroundColor() { FabulousText text = string.Empty; var expectedColor = new Rgb(128, 128, 128); var result = text.Grey; Assert.AreEqual(expectedColor, result.ForegroundColor); }
public static void Rgb_GivenValidColor_ReturnsNewObjectWithForegroundSet() { var expectedColor = new Rgb(12, 34, 56); FabulousText text = string.Empty; var result = text.Rgb(12, 34, 56); Assert.AreEqual(expectedColor, result.ForegroundColor); }
public static void ImplicitOp_GivenFabulousText_CreatesViaCtor() { FabulousText text = "abc"; FabulousTextCollection collection = text; var collectionText = collection.Fragments.Single(); Assert.AreEqual(text.Text, collectionText.Text); }
public static void Hidden_PropertyGet_ReturnsObjectWithHiddenDecorationSet() { FabulousText text = string.Empty; const TextDecoration expected = TextDecoration.Hidden; var result = text.Hidden; Assert.AreEqual(expected, result.Decorations); }
public static void Strikethrough_PropertyGet_ReturnsObjectWithStrikethroughDecorationSet() { FabulousText text = string.Empty; const TextDecoration expected = TextDecoration.Strikethrough; var result = text.Strikethrough; Assert.AreEqual(expected, result.Decorations); }
public static void BgWhiteBright_PropertyGet_ReturnsObjectWithWhiteBrightBackgroundColor() { FabulousText text = string.Empty; var expectedColor = new Rgb(255, 255, 255); var result = text.BgWhiteBright; Assert.AreEqual(expectedColor, result.BackgroundColor); }
public static void Underline_PropertyGet_ReturnsObjectWithUnderlineDecorationSet() { FabulousText text = string.Empty; const TextDecoration expected = TextDecoration.Underline; var result = text.Underline; Assert.AreEqual(expected, result.Decorations); }
public static void BgMagenta_PropertyGet_ReturnsObjectWithMagentaBackgroundColor() { FabulousText text = string.Empty; var expectedColor = new Rgb(139, 0, 139); var result = text.BgMagenta; Assert.AreEqual(expectedColor, result.BackgroundColor); }
public static void BgGrey_PropertyGet_ReturnsObjectWithGreyBackgroundColor() { FabulousText text = string.Empty; var expectedColor = new Rgb(169, 169, 169); var result = text.BgGrey; Assert.AreEqual(expectedColor, result.BackgroundColor); }
public static void Text_GivenValidText_SetsTextOnNewObject() { FabulousText text = "xyz"; const string replacement = "abc"; var result = text.Text(replacement); Assert.AreEqual(replacement, result.Text); }
public static void BgBlack_PropertyGet_ReturnsObjectWithBlackBackgroundColor() { FabulousText text = string.Empty; var expectedColor = new Rgb(0, 0, 0); var result = text.Black; Assert.AreEqual(expectedColor, result.BackgroundColor); }
public static void CyanBright_PropertyGet_ReturnsObjectWithCyanBrightForegroundColor() { FabulousText text = string.Empty; var expectedColor = new Rgb(0, 255, 255); var result = text.CyanBright; Assert.AreEqual(expectedColor, result.ForegroundColor); }
public static void Red_PropertyGet_ReturnsObjectWithRedForegroundColor() { FabulousText text = string.Empty; var expectedColor = new Rgb(139, 0, 0); var result = text.Red; Assert.AreEqual(expectedColor, result.ForegroundColor); }
public static void White_PropertyGet_ReturnsObjectWithWhiteForegroundColor() { FabulousText text = string.Empty; var expectedColor = new Rgb(192, 192, 192); var result = text.White; Assert.AreEqual(expectedColor, result.ForegroundColor); }
public static void BgYellow_PropertyGet_ReturnsObjectWithYellowBackgroundColor() { FabulousText text = string.Empty; var expectedColor = new Rgb(215, 195, 42); var result = text.BgYellow; Assert.AreEqual(expectedColor, result.BackgroundColor); }
public static void Background_GivenValidArgs_CreatesNewObject() { FabulousText text = "xyz"; var newBackground = Mock.Of <IColor>(); var result = text.Background(newBackground); Assert.AreNotSame(result, text); }
public static void Fragments_PropertyGet_ReturnsFragments() { FabulousText abc = "abc"; FabulousText def = "def"; var fragments = new[] { abc, def }; var collection = new FabulousTextCollection(fragments); Assert.AreSame(fragments, collection.Fragments); }
public static void ImplicitOp_GivenString_CreatesViaCtor() { const string abc = "abc"; FabulousText text = abc; FabulousTextCollection collection = abc; var collectionText = collection.Fragments.Single(); Assert.AreEqual(text.Text, collectionText.Text); }
public static void Keyword_GivenNullEmptyOrWhiteSpace_ThrowsArgNullException() { FabulousText text = string.Empty; Assert.Multiple(() => { Assert.Throws <ArgumentNullException>(() => text.Keyword(null)); Assert.Throws <ArgumentNullException>(() => text.Keyword(string.Empty)); Assert.Throws <ArgumentNullException>(() => text.Keyword(" ")); }); }