コード例 #1
0
        public void MethodTestGravaDados()
        {
            string path = Path.GetDirectoryName(Path.GetDirectoryName(Directory.GetCurrentDirectory()));

            path = path.Replace("\\UnitTestProjeto\\bin", "");
            string strNameFile       = path + "\\ArquivoDados.txt";
            string strNameFileIndice = path + "\\ArquivoIndice.txt";

            List <ITweet> listaTweets = new List <ITweet>();
            Tweets        tweets      = new Tweets();

            listaTweets.AddRange(tweets.BuscarTweets("", "", "", "", "#RockBand"));

            Principal p = new Principal();

            p.strNameFile       = strNameFile;
            p.strNameFileIndice = strNameFileIndice;
            p.GravarDados(listaTweets);
            BinarySearchAlgorithm bsa    = new BinarySearchAlgorithm();
            StrFileIndice         objeto = new StrFileIndice();

            if (bsa.BinarySearchById(1170023482421325824, strNameFileIndice, ref objeto))
            {
                Assert.AreEqual(1170023482421325824, objeto.Id);
            }
        }