Example #1
0
        public void PhoneNumber_Unit_Equals1_ObjIsDifferentType()
        {
            String countryCode = "1";
            String areaCode = "800";
            String[] subscriberNumberGroups = new String[] { "867", "5309" };
            PhoneNumber target = new PhoneNumber(countryCode, areaCode, subscriberNumberGroups);
            Object obj = countryCode + " " + areaCode + " " + subscriberNumberGroups.Join(' ');

            Boolean actual = target.Equals(obj);
            Assert.AreEqual(false, actual);
        }
        void DefaultWriteLogFunction(
            String assembly,
            String tag,
            String channel,
            String type,
            String time,
            String[] lines)
        {
            if (!this.enabledLogChannels.Contains (channel)) return;

            String startString = String.Format (
                "[{3}][{1}][{0}][{2}] ",
                time,
                type,
                channel,
                tag);

            if (!String.IsNullOrWhiteSpace (assembly))
                startString = String.Format ("[{0}]{1}", assembly, startString);

            String customNewLine = Environment.NewLine + new String (' ', startString.Length);

            String formatedLine = lines
                .Join (customNewLine);

            String log = startString + formatedLine;

            Console.WriteLine (log);
        }
Example #3
0
        public void RelativePath_Unit_ToString_RelativePathhasEmptyLastNode()
        {
            String[] nodes = new String[] { "sites", "Chad", "Greer", String.Empty };
            Char separator = RelativePath.ForwardSlash;
            RelativePath target = new RelativePath(nodes, separator);

            String actual = target.ToString();
            Assert.AreEqual(nodes.Join(separator), actual);
        }
Example #4
0
        public void RelativePath_Unit_InequalityOperator3_ObjAIsNull()
        {
            String[] nodes = new String[] { "sites", "Chad", "Greer" };
            Char separator = RelativePath.ForwardSlash;
            String objA = nodes.Join(separator);
            RelativePath objB = null;

            Boolean actual = objA != objB;
            Assert.AreEqual(true, actual);
        }
Example #5
0
        public void RelativePath_Unit_InequalityOperator2_EqualObjects()
        {
            String[] nodes = new String[] { "sites", "Chad", "Greer" };
            Char separator = RelativePath.ForwardSlash;
            RelativePath objA = new RelativePath(nodes, separator);
            String objB = nodes.Join(separator);

            Boolean actual = objA != objB;
            Assert.AreEqual(false, actual);
        }
Example #6
0
        public void RelativePath_Unit_ExplicitStringCastOperator_Optimal()
        {
            String[] nodes = new String[] { "sites", "Chad", "Greer" };
            Char separator = RelativePath.ForwardSlash;
            String instance = nodes.Join(separator);

            RelativePath actual = (RelativePath)instance;
            Assert.AreEqual(separator, actual.Separator);
            Assert.AreEqual(nodes.Length, actual.Nodes.Count());
            foreach (Int32 i in Enumerable.Range(0, nodes.Length)) {
                Assert.AreEqual(nodes[i], actual.Nodes.ElementAt(i));
            }
        }
Example #7
0
        public void RelativePath_Unit_Equals3_ObjIsEqualString()
        {
            String[] nodes = new String[] { "sites", "Chad", "Greer" };
            Char separator = RelativePath.ForwardSlash;
            RelativePath target = new RelativePath(nodes, separator);
            String other = nodes.Join(separator);

            Boolean actual = target.Equals(other);
            Assert.AreEqual(true, actual);
        }