public void SpudulikePrependsSpudBeforeSaving()
        {
            var fileWrapper = new FileWrapper();
            var spudulike   = new Spudulike(fileWrapper);

            spudulike.Save("Maris Piper");

            Assert.AreEqual("spud: Maris Piper", fileWrapper.ReadAllText("spudfile.txt"));
        }
示例#2
0
        public void SpudulikePrependsSpudBeforeSaving()
        {
            var spudulike = new Spudulike(this);

            spudulike.Save("Maris Piper");

            Assert.AreEqual("spud: Maris Piper", textWrittenToFile);
            Assert.AreEqual("spudfile.txt", fileWrittenTo);
        }
        public void SpudulikePrependsSpudBeforeSaving()
        {
            var fileWrapper = new Mock <IFileWrapper>();
            var spudulike   = new Spudulike(fileWrapper.Object);

            spudulike.Save("Maris Piper");

            fileWrapper.Verify(foo => foo.WriteAllText("spudfile.txt", "spud: Maris Piper"));
        }
        public void SpudulikePrependsSpudBeforeSaving()
        {
            var fileWrapper = new FileWrapperTestDouble();
            var spudulike   = new Spudulike(fileWrapper);

            spudulike.Save("Maris Piper");

            Assert.AreEqual("spud: Maris Piper", fileWrapper.TextWrittenToFile);
            Assert.AreEqual("spudfile.txt", fileWrapper.FileWrittenTo);
        }