public void Exists_When_CultureCode_Exists_Returns_True() { // Arrange var expected = new CultureStub(); // Act & Assert new List <ICulture> { expected }.Exists(expected.Code).ShouldBeTrue(); }
public void ToCultureInfo_Returns_Mapped_CultureInfo() { // Arrange var expected = new CultureStub(); // Act var result = expected.ToCultureInfo(); // Assert result.ShouldNotBeNull(); result.Name.ShouldBe(expected.Code); }
public void CultureCodes_Given_Custom_Delimiter_Returns_Custom_Delimited_Codes(string expectedDelimiter) { // Arrange var expectedCode = new CultureStub().Code; // Act var result = LocalizationUtils.CultureCodes(expectedDelimiter); // Assert result.ShouldNotBeNull(); result.ShouldContain(expectedCode); result.ShouldContain(expectedDelimiter); }
public void CultureCodes_Without_Arguments_Returns_Comma_Delimited_Codes() { // Arrange var expected = new CultureStub().Code; // Act var result = LocalizationUtils.CultureCodes(); // Assert result.ShouldNotBeNull(); result.ShouldContain(expected); result.ShouldContain(", "); }
public void CultureByCode_Given_CultureCode_Exists_Returns_Culture() { // Arrange var expected = new CultureStub().Code; // Act var result = LocalizationUtils.CultureByCode(expected); // Assert result.ShouldNotBeNull(); result.ShouldBeOfType <CultureStub>(); result.Code.ShouldBe(expected); }
public void ToCultureCodes_Given_Delimiter_IsValid_Returns_Custom_Delimited_Codes(string expectedDelimiter) { // Arrange var expectedCode = new CultureStub().Code; // Act var result = new List <ICulture> { new CultureStub(), new EnglishUnitedStates() }.ToCultureCodes(expectedDelimiter); // Assert result.ShouldNotBeNull(); result.ShouldContain(expectedCode); result.ShouldContain(expectedDelimiter); }
public void ToCultureInfos_Returns_ListOf_Mapped_CultureInfos() { // Arrange var expected = new CultureStub(); var expected2 = new EnglishUnitedStates(); var cultures = new List <ICulture> { expected, expected2 }; // Act var results = cultures.ToCultureInfos(); // Assert results.ShouldNotBeEmpty(); results.ShouldContain(e => e.Name == expected.Code); results.ShouldContain(e => e.Name == expected2.Code); }
public void ToCultureCodes_Without_Arguments_Returns_ListOf_CultureCodes() { // Arrange var expected = new CultureStub(); var expected2 = new EnglishUnitedStates(); var cultures = new List <ICulture> { expected, expected2 }; // Act var result = cultures.ToCultureCodes(); // Assert result.ShouldNotBeNull(); result.ShouldContain(expected.Code); result.ShouldContain(expected2.Code); }