Coming from Python where I can just fire up iPython to test out a small snippet of code I'm looking for the same in Visual Studio. Creating projects and classes just to test out a small idea just feels so cumbersome.
Tests can be run from Test Explorer by right-clicking in the code editor on a test and selecting Run test or by using the default Test Explorer shortcuts in Visual Studio. Some of the shortcuts are context-based. This means that they run or debug tests based on where your cursor is in the code editor.
Code snippets can be accessed in the following general ways: On the menu bar, choose Edit > IntelliSense > Insert Snippet. From the right-click or context menu in the code editor, choose Snippet > Insert Snippet.
Snippets are small scripts used in Postman which are used to verify an API. These are pre-developed scripts that can be utilized directly. Thus it helps to save a good amount of time. Snippets can be used in the Pre-request Script and Tests tabs in Postman.
You can also insert a snippet when logging an activity or leaving a comment on a record using the HubSpot mobile app for Android. There are two ways to add a snippet: Type the # symbol into the text editor. Start typing the snippet shortcut, then select the snippet from the dropdown menu.
You might want to look at LINQPad. It's particularly well suited for LINQ of course, but it's fine for other snippets too.
Personally I just use a simple text editor and Test.cs
in a test directory (c:\Users\Jon\Test) and compile from the command line :)
I keep a "Sandbox" project with a console application to do this kind of stuff.
Have a look at the Immediate Window in Visual Studio.
The Immediate window is used at design time to debug and evaluate expressions, execute statements, print variable values, and so forth. It allows you to enter expressions to be evaluated or executed by the development language during debugging.
To display the Immediate window, open a project for editing, then choose Windows from the Debug menu and select Immediate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With