- Title: C# Unit-Tests - Basics Cheat Sheet by AlienEngineer - Cheatography.com Created Date: 4240Z.
- If there is any problem with the.NET Framework from the C# Programmer’s perspective, it’s just that there is too much good stuff. A lot of classes have so many properties and events that it’s hard to remember what the most used stuff is. Here’s the cream of.
- This cheat sheet sums up the basics of C#, for experienced developers who are learning C# and users who already know programming basics, hopefully this document has helped you in some way, there was not much information or explaining but then again I’m assuming you’ve.
At Amazon you can download the new and expanded C# cheat sheet. It’s called C# – Three-Chapter Cheat Sheet.
C# 9 Cheat Sheet with code example and pros and cons. alugili/CSharp-9-CheatSheet.
It is divided into 3 sections, each section having 4 as listed below. The new version will have almost all of the old content, but I have decided to expand it and add a few new topics in each section as well as expand some topics to be more complete.
Free C# Cheat Sheet (12 pages)
Here below is the downloadable older C# Cheat Sheet from last year, 2019. I had taken it down but now, in August 2020 I’ve decided to put it back up for downloading. It has 12 pages. It’s just over half the size of the one over at Amazon.
Data Types
boolBoolean valuebyte8-bit unsigned integerchar
Type Conversion Methods
ToBooleanToByteToCharToDateTimeToDecimalToDoubleToInt16ToInt32ToInt64ToSbyteToSingleToStringToTypeToUInt16ToUInt32ToUInt64Naming Conventions
ClassMyClassMethodMyMethodLocal variablemyLocalVariablePrivate variable_myPrivateVariableConstantMyConstantArrays
int[] array = new int[] {1, 2, 3}int[] array = {1, 2, 3}var array = new int[] {1, 2, 3}int[] array = new int[3]Statements
if-elseif (true) {...}
else {...}switchswitch (var) {
case 1: break;
default: break; }forfor (int i =1; i < 5; i++) {...}foreach-inforeach (int item in array) {...}whilewhile (true) {...}do... while
Xpath Cheat Sheet C#
do {...}while (true);try-catch-finallytry {...}
catch (Exception e) {...}
catch {...}
finally {...}
Classes
Classpublic class Dog {...}Inheritancepublic class Dog: Pet {...}Constructor (no parameters)public Dog () {...}Constructors can co-existConstructor (one parameter)public Dog (string var) {...}Constructors can co-existFieldpublic string nameStatic Classpublic static class Dog {...}Must only have static membersStatic Memberpublic static int = 1Finalizer (destructor)~Dog () {...}Cannot have modifiers or parametersAccess Modifiers
publicAccessible by any other code in the same assembly or another assembly that references itprivateOnly accessible by code in the same class or structprotectedOnly accessible by code in the same class or struct, or in a derived classinternalAccessible by any code in the same assembly, but not from another assemblyprotected internalAccessible by any code in the same assembly, or by any derived class in another assemblyOther Modifiers
abstractIndicates that a class is intended only to be a base class of other classes
Assignment Operators
=Simple assignment+=Addition assignment-=Subtraction assignment*=Multiplication assignment/=Division assignment%=Remainder assignment&=AND assignment|=OR assignment^XOR assignment<<=Left-shift assignment>>=Right-shift assignmentComparison Operators
<Less than>Greater than<=Less than or equal to>=Greater than or equal toEqual to!=Not equal toArithmetic Operators
+Add numbers-Subtract numbers*Multiply numbers/Divide numbers%Compute remainder of division of numbers++Increases integer value by 1--Decreases integer value by 1Logical and Bitwise Operators
&&
Regex Cheat Sheet C#
&Binary AND|Oop Cheat Sheet C#
Binary OR^Binary XOR~Binary Ones Complement<<Binary Left Shift>>Binary Right ShiftOther Operators
sizeof()Returns the size of a data typetypeof()Returns the type of a class&Returns the address of a variable*Pointer to a variable
