Giter Club home page Giter Club logo

csharp-minifier's Introduction

Profile Views Counter

Ivan Kochurkin's GitHub Stats

csharp-minifier's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

csharp-minifier's Issues

Exception when minifying file containing nested classes with same inner name

Exception is thrown in MinifyLocalsAstVisitor.VisitMember when the code to minify contains nested static classes, where an inner class has the same name as another in a different enclosing class.

MWE:

public static class A
{
    public static class One
    {
        public void foo() {}
    }
}

public static class B
{
    public static class One
    {
        public void foo() {}
    }
}

Ignores interface signature

Code

    public interface IT
    {
        int Getter { get; }
        int Setter { set; }
        int GetterSetter { get; set; }
        void Method();
    }

    public class T : IT
    {
        public void Method() { }
        protected int Test = 0;
        public int Getter { get { return 1; } }
        public int Setter { set {  } }
        public int GetterSetter { get { return 2; } set { } }
    }

Result

public interface f{int a{get;}int b{set;}int c{get;set;}void d();}
public class g :f{public void a(){}protected int b=0;public int c{get{return 1;}}public int d{
set{}}public int e{get{return 2;}set{}}}

So you cant use interfaces...

Operator precedence error

Minifying:

var a = 2 * (y - --x);

Becomes

var b = 2*(h---g);

Which is infact

var b = 2*(h-- - g); 

Test

   [TestClass]
    public class UnitTest
    {
        [TestMethod]
        public void TestMethod()
        {
            var y = 4;
            var x = 6;
            var a = 2 * (y - --x);

            var h = 4;
            var g = 6;
            var b = 2*(h---g); //(h-- - g)

            Assert.AreEqual(a, b);
        }
    }

Preprocessor

Hi, I'm having problems with "preprocessor" conditions:

if I have the next code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CSharpMinifier.GUI
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
#if DEBUG
            string text  = "";
#else
            string myOtherTestText = "hi";
#endif
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmMain());
        }
    }
}

The code is not minified correctly:

using System;using System.Collections.Generic;using System.Linq;using System.
Threading.Tasks;using System.Windows.Forms;static class b{[STAThread]static void
Main(){
#if DEBUG
                                            string text  = "";
#else
var a="hi";
#endif
Application.EnableVisualStyles();Application.
SetCompatibleTextRenderingDefault(false);Application.Run(new frmMain());}}

As you see, the first variable's name "text" stills unminified.

Can you add "preprocessor" support?

Thank you very much!

Best regards,
Luciano Rasente

delegate functions like Action and Func break the minifier when called (workaround)

First of all, thanks for creating this project. It is awesome! I forked it to add a command line version of the app. I'm using it to minify code for the game Space Engineers which uses C# for in game programming and it has a character limit.

The issue I have been having is that the minifier fails to detect that when you call a delegate function it is the same as the variable it is stored in. For example, in the following code, the "op" and "callback" variables are minified when they are used as variables, but when they are used like a function in the handle method they don't get minified, so it causes errors.

public class EasyEvent
{ 
    private Func<EasyBlock,bool> op; // The comparison function 

    private EasyBlock obj; // Object to pass through to the callback when the event is triggered 

    private Func<EasyBlock,bool> callback; // What to call when the event occurs 

    public EasyEvent(EasyBlock obj, Func<EasyBlock,bool> op, Func<EasyBlock,bool> callback) 
    { 
        this.op = op; 
        this.callback = callback; 
        this.obj = obj; 
    } 

    public bool handle() 
    { 
        if(this.op(this.obj)) 
        { 
            return this.callback(this.obj); 
        } 

        return true; 
    } 
}

Don't worry about fixing this anytime soon unless you want to. There is an easy workaround. If you put parenthesis around the variable when it is used as a function like this: "(this.op)(this.obj)" it convinces the parser that it is a variable and then it works. :-)

Cant build current master

Error 4 'ICSharpCode.NRefactory.CSharp.BaseReferenceExpression' is a 'type' but is used like a 'variable' D:\GitSource\Repos\CSharp-Minifier\CSharpMinifier\Minifier.cs 813 33 CSharpMinifier

Error 1 The name 'nameof' does not exist in the current context D:\GitSource\Repos\CSharp-Minifier\CSharpMinifier\Minifier.cs 811 21 CSharpMinifier

inherited protected methods not recognized correctly.

"Compress members" breaks inheritance with protected members (parent class protected members are being renamed, child class protected (overriding) members arent).

class Parent {
  protected virtual var someMethod() {
  }
}
class Child : Parent {
  protected override var someMethod {
  }
}

results in:
class b{protected virtual var a(){}}class c:b{protected override var someMethod{}}

Minifier removes overriden ToString() method

On classes which override the method ToString() inherited from object, this method gets removed completely. This might also be the case for other methods inherited from object (but I didn't test this).

Example:

    class Test {
      public override string ToString() {
        return "my test class";
      }
    }

results in:

class a{}

Crash on same method with <Type> modifier.

If I have two methods with the same signature except for a Type modifier, the minifier will crash with a SystemArgumentException (see stacktrace).

Example:
class ABC {

  public void Test<String>() {
  }

  public void Test() {
  }

}

EDIT: This also happens if the methods have different Type modifiers (e.g. <int> and <String>).

The new node 'ExpressionStatement' is not valid in the role TryBlock

Environment

  • Windows 10 Pro (Build 15063)
  • Microsoft Visual Studio Community 2017 (Version 4.7.02046)

Description
I've got the Exception The new node 'ExpressionStatement' is not valid in the role TryBlock while trying to minify a class I made.
Exception: https://pastebin.com/3PqyyLdB
I added an try-catch block an I think it causes the exception.

Code I tried to minify: https://pastebin.com/gHeYAcSs
I think its the try-catch in line 167 causing this

Reproduce

  1. open in VS
  2. set CSharpMinifier.GUI as Start Project
  3. start
  4. insert code with try-catch
  5. hit minify
  6. exception

"Enum to int conversion" occasionally removes enum completely.

I didn't find a minimal example yet, but very often enums are completely missing where they should have simply been replaced by ints.

Sometimes also the ints are declared but not initialized (the actual value get's removed).

An example from my code:

class TextUtils {
    public enum FONT { DEFAULT, MONOSPACE };
    private static FONT selectedFont = FONT.DEFAULT;

    private static Dictionary<FONT, Dictionary<char, int>> LetterWidths = new Dictionary<FONT, Dictionary<char, int>>{
        {
            FONT.DEFAULT,
            new Dictionary<char, int> {
                {' ', 8 }
            }
        },
        {
            FONT.MONOSPACE,
            new Dictionary<char, int> {
                {' ', 24 }
            }
        }
    };
}

Results in:

class TextUtils{private static int selectedFont;private static Dictionary<int,Dictionary<char,int>>LetterWidths=new Dictionary<int,Dictionary<char,int>>{{new Dictionary<char,int>{{' ',8}}},{new Dictionary<char,int>{{' ',24}}}};}

Here the enums, which were used as Directionary keys, are missing.

Minifier breaks on base keyword

I also want to use this for Space Engineers because of its character limit.

I've found this annoying error. The following throws a null pointer exception. It cant handle the base keyword.

    public class A
    {
        public virtual int M()
        {
            return -1;
        }
    }

    public class B : A 
    {
        public override int M()
        {
            return base.M();
        }
    }

So i cant really use inheritance, which is like... bummer in a OO environment...

A workaround could be nested classes, but it seems there is some issues with that approach also.

Ignored code

This can be minified just fine:

public class Factory<T>
{
    public int Type;
    public Func<T> Create;
 }

 public interface IProvider
 {
     string Test { get;}
 }

 public class TheProvider : IProvider
 {
    public string Test { get { return "Hello"; } }
 }

But this will be ignored completly

public static Dictionary<String, Factory<IProvider>> t = new Dictionary<String, Factory<IProvider>>
{
    { "Tester", new Factory<IProvider> { Type = 1, Create = new Func<IProvider>(() => new TheProvider()) } }
};

Unable to parse empty if statements

If you have a statement like the following

if (a == b)
{ }

or

if (a == b) ;

The minifier seems to crash. The problem seems to be that GetLeafNodeString in Minifier.cs is assuming that the block contains something, but it is counted as empty (the node is set to ';' regarless or whether you used braces or a semicolon). The exception is below

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=CSharpMinifier
  StackTrace:
   at CSharpMinifier.Minifier.GetLeafNodeString(AstNode node) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 868
   at CSharpMinifier.Minifier.RemoveSpacesAndAppend(AstNode node, StringBuilder line, StringBuilder result) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 694
   at CSharpMinifier.Minifier.RemoveSpacesAndAppend(AstNode node, StringBuilder line, StringBuilder result) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 750
   at CSharpMinifier.Minifier.RemoveSpacesAndAppend(AstNode node, StringBuilder line, StringBuilder result) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 750
   at CSharpMinifier.Minifier.RemoveSpacesAndAppend(AstNode node, StringBuilder line, StringBuilder result) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 750
   at CSharpMinifier.Minifier.RemoveSpacesAndAppend(AstNode node, StringBuilder line, StringBuilder result) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 750
   at CSharpMinifier.Minifier.GetStringWithoutSpaces(IEnumerable`1 nodes) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 679
   at CSharpMinifier.Minifier.GetStringWithoutSpaces() in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 660
   at CSharpMinifier.Minifier.Minify() in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 148
   at CSharpMinifier.Minifier.MinifyFromString(String csharpCode) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 127
   at CSharpMinifier.GUI.frmMain.btnMinify_Click(Object sender, EventArgs e) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier.GUI\frmMain.cs:line 126
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at CSharpMinifier.GUI.Program.Main() in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier.GUI\Program.cs:line 16

Unable to parse expression bodies

I've found that it is unable to parse expression bodied like

float GetThrusterOverridePercent(List<IMyThrust> thrusters) => thrusters[0].ThrustOverridePercentage;

if you convert to block bodies

 float GetThrusterOverridePercent(List<IMyThrust> thrusters) { return thrusters[0].ThrustOverridePercentage; }

then it seems to compile just fine. So far, I've found this on both property and function expression bodies.

Edit: I forgot to add some actually useful info for nailing this bug down, so here it is. The property expression bodies and function expression bodies seem to throw different errors, so I'm not sure what the issue might be.

Property error:

System.ArgumentException
  HResult=0x80070057
  Message=An item with the same key has already been added.
  Source=mscorlib
  StackTrace:
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at CSharpMinifier.MinifyLocalsAstVisitor.VisitMember(String memberName, IEnumerable`1 parameters) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\MinifyLocalsAstVisitor.cs:line 114
   at CSharpMinifier.MinifyLocalsAstVisitor.VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\MinifyLocalsAstVisitor.cs:line 86
   at ICSharpCode.NRefactory.CSharp.ConstructorDeclaration.AcceptVisitor(IAstVisitor visitor)
   at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren(AstNode node)
   at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitTypeDeclaration(TypeDeclaration typeDeclaration)
   at CSharpMinifier.MinifyLocalsAstVisitor.VisitTypeDeclaration(TypeDeclaration typeDeclaration) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\MinifyLocalsAstVisitor.cs:line 44
   at ICSharpCode.NRefactory.CSharp.TypeDeclaration.AcceptVisitor(IAstVisitor visitor)
   at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren(AstNode node)
   at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration)
   at CSharpMinifier.MinifyLocalsAstVisitor.VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\MinifyLocalsAstVisitor.cs:line 38
   at ICSharpCode.NRefactory.CSharp.NamespaceDeclaration.AcceptVisitor(IAstVisitor visitor)
   at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren(AstNode node)
   at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitSyntaxTree(SyntaxTree syntaxTree)
   at ICSharpCode.NRefactory.CSharp.SyntaxTree.AcceptVisitor(IAstVisitor visitor)
   at CSharpMinifier.Minifier.CompileAndAcceptVisitor(DepthFirstAstVisitor visitor) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 496
   at CSharpMinifier.Minifier.CompressLocals() in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 401
   at CSharpMinifier.Minifier.Minify() in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 136
   at CSharpMinifier.Minifier.MinifyFromString(String csharpCode) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 127
   at CSharpMinifier.GUI.frmMain.btnMinify_Click(Object sender, EventArgs e) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier.GUI\frmMain.cs:line 126
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at CSharpMinifier.GUI.Program.Main() in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier.GUI\Program.cs:line 16

Function error:

System.InvalidCastException
  HResult=0x80004002
  Message=Unable to cast object of type 'ICSharpCode.NRefactory.CSharp.ErrorNode' to type 'ICSharpCode.NRefactory.CSharp.CSharpTokenNode'.
  Source=CSharpMinifier
  StackTrace:
   at CSharpMinifier.MinifyMembersAstVisitor.VisitTypeDeclaration(TypeDeclaration typeDeclaration) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\MinifyMembersAstVisitor.cs:line 80
   at ICSharpCode.NRefactory.CSharp.TypeDeclaration.AcceptVisitor(IAstVisitor visitor)
   at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren(AstNode node)
   at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitSyntaxTree(SyntaxTree syntaxTree)
   at ICSharpCode.NRefactory.CSharp.SyntaxTree.AcceptVisitor(IAstVisitor visitor)
   at CSharpMinifier.Minifier.CompileAndAcceptVisitor(DepthFirstAstVisitor visitor) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 496
   at CSharpMinifier.Minifier.CompressMembers() in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 423
   at CSharpMinifier.Minifier.Minify() in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 138
   at CSharpMinifier.Minifier.MinifyFromString(String csharpCode) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier\Minifier.cs:line 127
   at CSharpMinifier.GUI.frmMain.btnMinify_Click(Object sender, EventArgs e) in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier.GUI\frmMain.cs:line 126
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at CSharpMinifier.GUI.Program.Main() in C:\Users\luke\Documents\Development\External\CSharp-Minifier\CSharpMinifier.GUI\Program.cs:line 16

Problems with abstract keyword

Code

   public abstract class ATest
    {
        public abstract int MyMethod();
    }

    public class MyTest : ATest
    {
        public override int MyMethod()
        {
            return -1;
        }
    }

Result

    public abstract class b { public abstract int a();}
    public class c : b { public override int MyMethod() { return -1; } }

Attempt to workaround Code:

    public abstract class ATest
    {
        public virtual int MyMethod() { return -1; }
    }

    public class MyTest : ATest
    {
        public override int MyMethod()
        {
            return -1;
        }
    }

Result

public abstract class b{public virtual int a(){return-1;}}public class c:b{
public override int MyMethod(){return-1;}}

Another attempt to workaround

     public class ATest
    {
        public virtual int MyMethod() { return -1; }
    }

    public class MyTest : ATest
    {
        public override int MyMethod()
        {
            return -1;
        }
    }

Result

public class b{public virtual int a(){return-1;}}public class c:b{public
override int MyMethod(){return-1;}}

Yet another attempt

    public class ATest
    {
        public virtual int MyMethod() { return -1; }
    }

    public class MyTest : ATest
    {
        public new int MyMethod()
        {
            return -1;
        }
    }

Result:

public class b{public virtual int a(){return-1;}}public class c:b{public new int
a(){return-1;}}

Now were getting somewhere.

Because you cant use new keyword when overriding a abstract method, it has to be virtual.

Workaround is:

    public abstract class ATest
    {
        public virtual int MyMethod() { return -1; }
    }

    public class MyTest : ATest
    {
        public new int MyMethod()
        {
            return base.MyMethod();
        }
    }

Result

    public abstract class b { public virtual int a() { return -1; } }
    public class c : b
    {
        public new int a() { return base.a(); }
    }

Which pass this test

    [TestClass]
    public class UnitTest
    {
        [TestMethod]
        public void TestMethod()
        {
            b t = new c();
            Assert.AreEqual(-1, t.a());
        }
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.