public void Returns_true_when_the_guids_can_be_valid() { var retriever = new GuidValueRetriever(); retriever.IsAValidGuid("0").ShouldBeTrue(); retriever.IsAValidGuid("{47B864A3-DEB9-4222-B7F8-F176F2E2CEFF}").ShouldBeTrue(); }
public void Returns_an_empty_guid_when_passed_invalid_value() { var retriever = new GuidValueRetriever(); retriever.GetValue(null).ShouldEqual(new Guid()); retriever.GetValue("").ShouldEqual(new Guid()); retriever.GetValue("xxxxx").ShouldEqual(new Guid()); }
public void Returns_false_when_the_guids_contain_invalid_characters() { var retriever = new GuidValueRetriever(); retriever.IsAValidGuid("z").ShouldBeFalse(); retriever.IsAValidGuid("{9537F8CA-EB2B-4B8A-97D5-705778AAD1G5}").ShouldBeFalse(); }
public void Returns_a_guid_when_passed_a_lower_case_guid() { var retriever = new GuidValueRetriever(); retriever.GetValue("6734cd2c-215b-4f4c-87c0-363ecac6b9c1") .ShouldEqual(new Guid("6734CD2C-215B-4F4C-87C0-363ECAC6B9C1")); retriever.GetValue("2a6e290d-5c4c-4f6d-92f7-0a5cda038fcd") .ShouldEqual(new Guid("2A6E290D-5C4C-4F6D-92F7-0A5CDA038FCD")); }
public void Returns_a_guid_when_wrapped_in_curly_braces() { var retriever = new GuidValueRetriever(); retriever.GetValue("{A04BE0E5-D9EE-4188-993B-899FF82A2B68}") .ShouldEqual(new Guid("A04BE0E5-D9EE-4188-993B-899FF82A2B68")); retriever.GetValue("{BF114C72-618C-48EC-98FE-F2804256A280}") .ShouldEqual(new Guid("BF114C72-618C-48EC-98FE-F2804256A280")); }
public void Returns_a_guid_when_passed_a_valid_guid_string() { var retriever = new GuidValueRetriever(); retriever.GetValue("6734CD2C-215B-4F4C-87C0-363ECAC6B9C1") .ShouldEqual(new Guid("6734CD2C-215B-4F4C-87C0-363ECAC6B9C1")); retriever.GetValue("2A6E290D-5C4C-4F6D-92F7-0A5CDA038FCD") .ShouldEqual(new Guid("2A6E290D-5C4C-4F6D-92F7-0A5CDA038FCD")); }
public void Adds_trailing_zeroes_when_passed_32_valid_guid_character() { var retriever = new GuidValueRetriever(); retriever.GetValue("12000000-0000-0000-0000-00000000001") .Should().Be(new Guid("12000000-0000-0000-0000-000000000010")); retriever.GetValue("23000000-0000-0000-0000-00000000009") .Should().Be(new Guid("23000000-0000-0000-0000-000000000090")); retriever.GetValue("DF000000-0000-0000-0000-00000000007") .Should().Be(new Guid("DF000000-0000-0000-0000-000000000070")); }
public void Adds_trailing_zeroes_when_passed_one_valid_guid_character() { var retriever = new GuidValueRetriever(); retriever.GetValue("1") .Should().Be(new Guid("10000000-0000-0000-0000-000000000000")); retriever.GetValue("2") .Should().Be(new Guid("20000000-0000-0000-0000-000000000000")); retriever.GetValue("F") .Should().Be(new Guid("F0000000-0000-0000-0000-000000000000")); }
public void Adds_trailing_zeroes_when_passed_two_valid_guid_character() { var retriever = new GuidValueRetriever(); retriever.GetValue("12") .ShouldEqual(new Guid("12000000-0000-0000-0000-000000000000")); retriever.GetValue("23") .ShouldEqual(new Guid("23000000-0000-0000-0000-000000000000")); retriever.GetValue("DF") .ShouldEqual(new Guid("DF000000-0000-0000-0000-000000000000")); }
public GuidValueComparer(GuidValueRetriever guidValueRetriever) { this.guidValueRetriever = guidValueRetriever; }
public void Returns_false_when_the_guid_is_empty() { var retriever = new GuidValueRetriever(); retriever.IsAValidGuid(string.Empty).ShouldBeFalse(); }
public void Returns_false_when_the_guid_is_null() { var retriever = new GuidValueRetriever(); retriever.IsAValidGuid(null).ShouldBeFalse(); }
public void Adds_trailing_zeroes_when_passed_9_valid_guid_characters_with_no_dashes() { var retriever = new GuidValueRetriever(); retriever.GetValue("123456789") .Should().Be(new Guid("12345678-9000-0000-0000-000000000000")); retriever.GetValue("121212123") .Should().Be(new Guid("12121212-3000-0000-0000-000000000000")); }