Skip to content

Commit

Permalink
+++ Added Enums test
Browse files Browse the repository at this point in the history
*** Fixed RegressionTest bugs
  • Loading branch information
AlexAlbala committed Dec 17, 2013
1 parent 68fbbf1 commit ed9295a
Show file tree
Hide file tree
Showing 10 changed files with 188 additions and 0 deletions.
1 change: 1 addition & 0 deletions 028.Enums/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Output/
Binary file added 028.Enums/NETbin/Enums.exe
Binary file not shown.
Binary file added 028.Enums/NETbin/Enums.pdb
Binary file not shown.
20 changes: 20 additions & 0 deletions 028.Enums/src/Enums.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enums", "Enums\Enums.csproj", "{57DFDC9E-A645-4EAC-BE08-94E59B6BECFF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{57DFDC9E-A645-4EAC-BE08-94E59B6BECFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{57DFDC9E-A645-4EAC-BE08-94E59B6BECFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57DFDC9E-A645-4EAC-BE08-94E59B6BECFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57DFDC9E-A645-4EAC-BE08-94E59B6BECFF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file added 028.Enums/src/Enums.v11.suo
Binary file not shown.
2 changes: 2 additions & 0 deletions 028.Enums/src/Enums/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/bin/
/obj/
55 changes: 55 additions & 0 deletions 028.Enums/src/Enums/Enums.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{57DFDC9E-A645-4EAC-BE08-94E59B6BECFF}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Enums</RootNamespace>
<AssemblyName>Enums</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
74 changes: 74 additions & 0 deletions 028.Enums/src/Enums/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using System;

namespace Enums
{
public enum MyEnum : int
{
NONE = 0,
ONE = 1
}

public enum MyDisorderedEnum : int
{
ONE = 1,
NONE = 0
}

public enum MyIncompleteEnum : int
{
SEVEN = 7,
EIGHT = 8
}

public class Program
{

public static void Main()
{
MyEnum e = MyEnum.NONE;

if (e == MyEnum.NONE)
{
Console.WriteLine("Uquality working");
}

e = (MyEnum)1;
Console.WriteLine("case 1 -> should print \"ONE\": ");
Console.WriteLine(e);

int result = (int)e;
Console.WriteLine("case 2 -> should print \"1\": ");
Console.WriteLine(result);

MyIncompleteEnum ie = MyIncompleteEnum.SEVEN;

if (ie == MyIncompleteEnum.SEVEN)
{
Console.WriteLine("Uquality working");
}

ie = (MyIncompleteEnum)7;
Console.WriteLine("case 3 -> should print \"SEVEN\": ");
Console.WriteLine(ie);

int result2 = (int)ie;
Console.WriteLine("case 4 -> should print \"7\": ");
Console.WriteLine(result2);

MyDisorderedEnum de = MyDisorderedEnum.ONE;

if (de == MyDisorderedEnum.ONE)
{
Console.WriteLine("Uquality working");
}

de = (MyDisorderedEnum)1;
Console.WriteLine("case 5 -> should print \"ONE\": ");
Console.WriteLine(de);

int result3 = (int)de;
Console.WriteLine("case 6 -> should print \"1\": ");
Console.WriteLine(result3);
}
}
}
36 changes: 36 additions & 0 deletions 028.Enums/src/Enums/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Enums")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Enums")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("45aa6524-b250-4fc1-94cc-ee782bfe9a3a")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file modified RegressionTest.exe
Binary file not shown.

0 comments on commit ed9295a

Please sign in to comment.