Esempio n. 1
0
        public void EqualsTest_equal()
        {
            // arrange
            FakeDatasource fake = new FakeDatasource();

            rssChannelItem target = fake.GetrssChannelItem(5);
            rssChannelItem obj = fake.GetrssChannelItem(5);
            bool actual;

            // act
            actual = target.Equals(obj);

            // assert
            Assert.IsTrue(actual);
        }
Esempio n. 2
0
        public void EqualsTest_notequalcontent()
        {
            // arrange
            FakeDatasource fake = new FakeDatasource();

            rssChannelItem target = fake.GetrssChannelItem(5);
            rssChannelItem obj = fake.GetrssChannelItem(5);

            obj.status = "asdfasdfasdf";

            bool actual;

            // act
            actual = target.Equals(obj);

            // assert
            Assert.IsFalse(actual);
        }
        public void EqualsTest_notequallength()
        {
            // arrange
            FakeDatasource fake = new FakeDatasource();

            rssChannelImage target = fake.GetrssChannelImage(5);
            rssChannelImage obj = fake.GetrssChannelImage(4);

            bool actual;

            // act
            actual = target.Equals(obj);

            // assert
            Assert.IsFalse(actual);
        }
Esempio n. 4
0
        public void SetTest_wParams()
        {
            // arrange
            string pathToFilename = Setup.GetDataPath();

            HttpContextBase httpContext = null;
            FileDatasource target = new FileDatasource(pathToFilename, httpContext);

            // grab a fake
            FakeDatasource fake = new FakeDatasource();

            RssIssues issues = fake.RssIssues;
            string filename = "FileDatasource_SetTest_wParams";
            string fullpathandfilename = pathToFilename + filename;

            // act
            target.Set(issues, fullpathandfilename);

            // assert
            File.Exists(fullpathandfilename);

            // make sure I can deserialize
            RssIssues deserialized = target.Get(fullpathandfilename);
            Assert.AreEqual(issues, deserialized);

            // cleanup
            File.Delete(fullpathandfilename);
        }