示例#1
0
        public static void Equals_ReturnsFalse_ForDistinctValues(string value1, string value2)
        {
            var bic1 = Bic.Parse(value1).Value;
            var bic2 = Bic.Parse(value2).Value;

            Assert.False(bic1.Equals(bic2));
        }
示例#2
0
        public static void Equals_ReturnsTrue_ForIdenticalValues_AfterBoxing(string value1, string value2)
        {
            var    bic1 = Bic.Parse(value1).Value;
            object bic2 = Bic.Parse(value2).Value;

            Assert.True(bic1.Equals(bic2));
        }
示例#3
0
        public static void Inequality_ReturnsFalse_ForIdenticalValues(string value1, string value2)
        {
            var bic1 = Bic.Parse(value1).Value;
            var bic2 = Bic.Parse(value2).Value;

            Assert.False(bic1 != bic2);
        }
示例#4
0
        public static void Inequality_ReturnsTrue_ForDistinctValues(string value1, string value2)
        {
            var bic1 = Bic.Parse(value1).Value;
            var bic2 = Bic.Parse(value2).Value;

            Assert.True(bic1 != bic2);
        }
示例#5
0
        public static void Equality_ReturnsTrue_ForIdenticalValues(string value1, string value2)
        {
            var bic1 = Bic.Parse(value1).Value;
            var bic2 = Bic.Parse(value2).Value;

            Assert.True(bic1 == bic2);
        }
示例#6
0
        public static void Equals_IsAbelian(string value1, string value2)
        {
            var bic1a = Bic.Parse(value1).Value;
            var bic1b = Bic.Parse(value1).Value;
            var bic2  = Bic.Parse(value2).Value;

            Assert.Equal(bic1a.Equals(bic1b), bic1b.Equals(bic1a));
            Assert.Equal(bic1a.Equals(bic2), bic2.Equals(bic1a));
        }
示例#7
0
        public static void Equals_ReturnsFalse_ForOtherTypes(string value)
        {
            var bic = Bic.Parse(value).Value;

            Assert.False(bic.Equals(null));
            Assert.False(bic.Equals(1));
            Assert.False(bic.Equals(value));
            Assert.False(bic.Equals(new Object()));
            Assert.False(bic.Equals(new My.Val(1)));
            Assert.False(bic.Equals(new My.Obj()));
        }
示例#8
0
        public static void Parse_SetBusinessPartyCorrectly(string value, string expectedValue)
        {
            var bic = Bic.Parse(value);

            Assert.Equal(expectedValue, bic.Value.BusinessParty);
        }
示例#9
0
        public static void ToString_ReturnsValue(string value)
        {
            var bic = Bic.Parse(value).Value;

            Assert.Equal(value, bic.ToString());
        }
示例#10
0
 public static void Parse_ReturnsNull_ForInvalidSwiftValue(string value)
 => Assert.False(Bic.Parse(value, BicVersion.Swift).HasValue);
示例#11
0
        public static void GetHashCode_ReturnsHashCodeValue(string value)
        {
            var bic = Bic.Parse(value).Value;

            Assert.Equal(value.GetHashCode(), bic.GetHashCode());
        }
示例#12
0
        public static void Equals_IsReflexive(string value)
        {
            var bic = Bic.Parse(value).Value;

            Assert.True(bic.Equals(bic));
        }
示例#13
0
        public static void Parse_ReturnsTrue_ForValidISOInput(string value)
        {
            var bic = Bic.Parse(value, BicVersion.ISO);

            Assert.True(bic.HasValue);
        }
示例#14
0
        public static void Parse_SetLocationCodeCorrectly(string value, string expectedValue)
        {
            var bic = Bic.Parse(value);

            Assert.Equal(expectedValue, bic.Value.LocationCode);
        }
示例#15
0
 public static void Parse_ReturnsNull_ForInvalidLength(string value)
 => Assert.False(Bic.Parse(value).HasValue);
示例#16
0
 public static void Parse_ReturnsNull_ForNull()
 => Assert.False(Bic.Parse(null).HasValue);
示例#17
0
        public static void Parse_ReturnsFalse_ForInvalidSwiftInput(string value)
        {
            var bic = Bic.Parse(value, BicVersion.Swift);

            Assert.False(bic.HasValue);
        }
示例#18
0
 public static void Parse_Succeeds_ForValidSwiftValue(string value)
 => Assert.True(Bic.Parse(value, BicVersion.Swift).HasValue);
示例#19
0
        public static void Parse_SetIsSwiftConnectedCorrectly(string value, bool expectedValue)
        {
            var bic = Bic.Parse(value);

            Assert.Equal(expectedValue, bic.Value.IsSwiftConnected);
        }
示例#20
0
        public static void Parse_SetIsPrimaryOfficeCorrectly(string value, bool expectedValue)
        {
            var bic = Bic.Parse(value);

            Assert.Equal(expectedValue, bic.Value.IsPrimaryOffice);
        }