Example #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));
        }
Example #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));
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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));
        }
Example #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()));
        }
Example #8
0
        public static void Parse_SetBusinessPartyCorrectly(string value, string expectedValue)
        {
            var bic = Bic.Parse(value);

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

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

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

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

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

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

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

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

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