Ejemplo n.º 1
0
 public bool AwaitShallNotBeOmittedInUsing()
 {
     using (new MemoryStream())
     {
         return(SimpleFile.Write(""));
     }
 }
Ejemplo n.º 2
0
 public Thread Test()
 {
     return(new Thread(() =>
     {
         SimpleFile.Write(nameof(Test));
     }));
 }
Ejemplo n.º 3
0
 public void EnumerableQueryExpression()
 {
     var enumerable =
         from o in System.Linq.Enumerable.Range(1, 10)
         where SimpleFile.Write("")
         select SimpleFile.Write(o.ToString());
 }
Ejemplo n.º 4
0
        public void Test()
        {
            Assert.That(1, Is.EqualTo(1));

            Assert.That(() =>
            {
                SimpleFile.Read();
                return(true);
            }, Is.EqualTo(true));

            Assert.That(() =>
            {
                SimpleFile.Read();
                return(true);
            });

            Assert.That(() =>
            {
                SimpleFile.Read();
            }, Throws.Nothing);

            Assert.That(() =>
            {
                Console.WriteLine("");
            }, Throws.Nothing);

            var result = false;

            Assert.That(() => result = SimpleFile.Write(""), Throws.Nothing);
            Assert.IsTrue(result);
        }
Ejemplo n.º 5
0
 public void Test()
 {
     var obj = new
     {
         test = SimpleFile.Write("")
     };
 }
Ejemplo n.º 6
0
 public void Test()
 {
     Runner.Run(s =>
     {
         SimpleFile.Clear();
         SimpleFile.Write("");
     });
 }
Ejemplo n.º 7
0
 public void Test()
 {
     Runner.RunGeneric(() =>
     {
         SimpleFile.Clear();
         return(SimpleFile.Write(""));
     });
 }
Ejemplo n.º 8
0
 public void Test()
 {
     Assert.That(() =>
     {
         SimpleFile.Clear();
         return(SimpleFile.Write(""));
     }, Throws.Nothing);
 }
Ejemplo n.º 9
0
 public override bool ReadWrite(string content)
 {
     SimpleFile.Read();
     for (var i = 0; i < 10; i++)
     {
         SimpleFile.Write(content);
     }
     return(SimpleFile.Write(content));
 }
Ejemplo n.º 10
0
 public bool Write()
 {
     if (_lastWrite.HasValue)
     {
         return(_lastWrite.Value);
     }
     _lastWrite = SimpleFile.Write(Content);
     return(_lastWrite.Value);
 }
Ejemplo n.º 11
0
 public bool IfAsyncOmitted(string content)
 {
     {
         if (content == null)
         {
             return(SimpleFile.Write(null));
         }
         return(content == "" ? SimpleFile.Write(content) : false);
     }
 }
Ejemplo n.º 12
0
        public IEnumerable <bool> GetBools(bool value)
        {
            yield return(SimpleFile.Write(""));

            if (!value)
            {
                yield break;
            }
            yield return(true);
        }
Ejemplo n.º 13
0
 public void IfElseNoBlockAsyncOmitted2(string content)
 {
     if (content == null)
     {
         Console.WriteLine();
     }
     else
     {
         SimpleFile.Write(null);
     }
 }
Ejemplo n.º 14
0
 public bool AwaitShallNotBeOmittedInTry()
 {
     try
     {
         return(SimpleFile.Write(""));
     }
     catch (Exception e)
     {
         throw new AggregateException(e);
     }
 }
Ejemplo n.º 15
0
 public bool MultipleReturns(bool value)
 {
     SimpleFile.Clear();
     if (value)
     {
         return(SimpleFile.Write("A"));
     }
     else
     {
         return(SimpleFile.Write("B"));
     }
 }
Ejemplo n.º 16
0
 public void IfElseNoBlockAsyncOmitted(string content)
 {
     // Verrryyyyyyy looooooooooong
     // comeeeeeeeeent
     if (content == null)
     {
         SimpleFile.Write(null);
     }
     else
     {
         SimpleFile.Write(null);
     }
 }
Ejemplo n.º 17
0
        public bool Read10()
        {
            var result = false;

            Assert.That(() => result = SimpleFile.Write(""), Throws.Nothing);

            RunFunction test = null;

            Assert.That(() => test = SimpleFile.Write <RunFunction>(""), Throws.Nothing);

            SimpleFile.Read();
            return(result);
        }
Ejemplo n.º 18
0
 public override bool Write(string content)
 {
     if (content == null)
     {
         throw new ArgumentNullException(nameof(content));
     }
     SimpleFile.Read();
     for (var i = 0; i < 10; i++)
     {
         SimpleFile.Write(content);
     }
     return(SimpleFile.Write(content));
 }
Ejemplo n.º 19
0
        public void Test()
        {
            var reader = new Reader();

            reader.Read().Read();

            var str = SimpleFile
                      .Write("")
                      .ToString();

            Assert.IsTrue(
                SimpleFile
                .Write("").Equals(true));
        }
Ejemplo n.º 20
0
 public void ReadAsyncNotOmitted(string path)
 {
     if (path != "")
     {
         SimpleFile.Read();
     }
     else if (path == "/")
     {
         for (int i = 0; i < 10; i++)
         {
             SimpleFile.Read();
         }
     }
     else if (SimpleFile.Write(""))
     {
         SimpleFile.Write("");
     }
 }
Ejemplo n.º 21
0
        public void Write()
        {
            Runner.Run(s =>
            {
                SimpleFile.Write(_content);
            });

            var arr = new List <Action>
            {
                () =>
                {
                    SimpleFile.Write(_content2);
                },
                delegate
                {
                    File.Open(_content3, FileMode.Append);
                }
            };
        }
Ejemplo n.º 22
0
        public void Write()
        {
            Runner.Run(s =>
            {
                Test();
                SimpleFile.Write("");
            });

            var arr = new List <Action>
            {
                () =>
                {
                    Test2();
                    SimpleFile.Write("");
                },
                delegate
                {
                    File.Open(Test3(), FileMode.Append);
                }
            };
        }
Ejemplo n.º 23
0
 private bool Write()
 {
     return(SimpleFile.Write(""));
 }
Ejemplo n.º 24
0
 public IList <T> Write <T>(string path)
 {
     SimpleFile.Write(path);
     return(new List <T>());
 }
Ejemplo n.º 25
0
 public bool ConditionAsyncOmitted2(string content)
 {
     return(content == "" ? SimpleFile.Write(null) : SimpleFile.Write(content));
 }
Ejemplo n.º 26
0
 public IList <IEnumerable <T> > ComplexWrite <T>(string path)
 {
     SimpleFile.Write(path);
     return(new List <IEnumerable <T> >());
 }
Ejemplo n.º 27
0
 public bool ExpressionReturn() => SimpleFile.Write("");
Ejemplo n.º 28
0
 public bool DoubleCallReturn()
 {
     return(SimpleFile.Write(ReadFile()));
 }
Ejemplo n.º 29
0
 public bool SimpleReturn()
 {
     return(SimpleFile.Write(""));
 }
Ejemplo n.º 30
0
 public void Write()
 {
     SimpleFile.Write("");
 }