Ejemplo n.º 1
0
        public void TestTickerCompare()
        {
            var testTickers = new[]
            {
                new TickerSymbol {
                    InstrumentType = "Common Stock", Symbol = "NFLX:US", Country = "USA"
                },
                new TickerSymbol {
                    InstrumentType = "BDR", Symbol = "NFLX34:BZ", Country = "Brazil"
                },
                new TickerSymbol {
                    InstrumentType = "Common Stock", Symbol = "NFC:GR", Country = "Germany"
                },
                new TickerSymbol {
                    InstrumentType = "Common Stock", Symbol = "NFLX:SW", Country = "Switzerland"
                },
                new TickerSymbol {
                    InstrumentType = "Common Stock", Symbol = "NFLX*:MM", Country = "Mexico"
                },
            };

            var testSubject = new TickerComparer("NETFLIX INC");

            var testInput = testTickers.ToList();

            testInput.Sort(testSubject);

            var testResult = testInput.First();

            Assert.IsTrue(testResult.Equals(new TickerSymbol {
                InstrumentType = "Common Stock", Symbol = "NFLX:US", Country = "USA"
            }));
        }
Ejemplo n.º 2
0
        public void TestTickerCompare()
        {
            var testTickers = new Ticker[]
            {
                new Ticker {InstrumentType = "Common Stock", Symbol = "NFLX:US", Country = "USA"},
                new Ticker {InstrumentType = "BDR", Symbol = "NFLX34:BZ", Country = "Brazil"},
                new Ticker {InstrumentType = "Common Stock", Symbol = "NFC:GR", Country = "Germany"},
                new Ticker {InstrumentType = "Common Stock", Symbol = "NFLX:SW", Country = "Switzerland"},
                new Ticker {InstrumentType = "Common Stock", Symbol = "NFLX*:MM", Country = "Mexico"},
            };

            var testSubject = new TickerComparer("NETFLIX INC");

            var testInput = testTickers.ToList();

            testInput.Sort(testSubject);

            var testResult = testInput.First();

            Assert.IsTrue(testResult.Equals(new Ticker {InstrumentType = "Common Stock", Symbol = "NFLX:US", Country = "USA"}));
        }