This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int GetTotalStock(Guid ProductGuid) | |
{ | |
DataSet dsStock = new ProductsService().GetStockCount(ProductGuid); | |
if (dsStock.Tables != null) | |
{ | |
if (dsStock.Tables[0].Rows.Count > 0) | |
{ | |
if (dsStock.Tables[0].Rows[0]["TotalStock"] != null) | |
{ | |
return int.Parse(dsStock.Tables[0].Rows[0]["TotalStock"].ToString()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_project_name | |
return ENV['TEAMCITY_PROJECT_NAME'].to_s unless ENV['TEAMCITY_PROJECT_NAME'].nil? | |
return "PROJECT_NAME_NOT_SET" | |
end | |
def get_version | |
buildnumber = ENV['BUILD_NUMBER'].to_s unless ENV['BUILD_NUMBER'].nil? | |
svnrevision = ENV['BUILD_VCS_NUMBER_' + SIMPLIFIED_VCS_NAME].to_s unless ENV['BUILD_VCS_NUMBER_' + SIMPLIFIED_VCS_NAME].nil? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUILD = { :Mode => 'Debug' } | |
require 'albacore' | |
require 'build/tasks.rb' | |
require 'fileutils' | |
task :default => [:debug] | |
task :debug => [:assemblyinfo, :set_debug_mode, :msbuild, :runtests] | |
task :release => [:assemblyinfo, :set_release_mode, :msbuild, :runtests, :publish, :pre_package_source, :package_source, :package_published] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using NinjaTools.Builders; | |
using NinjaTools.Helpers; | |
using NinjaTools.NHDynamicTable.Core.Model; | |
using NinjaTools.NHDynamicTable.Core.Model.Enums; | |
namespace NinjaTools.NHDynamicTable.Core.Builders | |
{ | |
public class DynamicTableBuilder : AbstractBuilder<DynamicTable, DynamicTableBuilder> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestFixture] | |
public class FooBar : as_sql_server_integration_test | |
{ | |
[Test] | |
public void LoadingFromGoogleTest() | |
{ | |
IEnumerable<string> metrics; | |
IEnumerable<string> dimensions; | |
var data = GetAnalyticsData(out metrics, out dimensions); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FluentNHibernateFacility : NHibernateFacility | |
{ | |
protected override void Init() | |
{ | |
var connectionString = FacilityConfig.Attributes["connection_string"]; | |
if (string.IsNullOrEmpty(connectionString)) | |
throw new ConfigurationErrorsException("No connection string has been supplied. Please supply a connection string."); | |
var factoryConfig = BuildFactory(connectionString); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Castle.Windsor; | |
using Castle.Windsor.Configuration; | |
using Castle.Windsor.Configuration.Interpreters; | |
using Core.Castle.Installers; | |
namespace Core.Castle | |
{ | |
public class IoCContainer : WindsorContainer | |
{ | |
public IoCContainer() : this(new XmlInterpreter("windsor.config.xml")) { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
namespace Core | |
{ | |
public class GoogleTokenQuery | |
{ | |
const string AuthenticationUrlFormat = "accountType=GOOGLE&Email={0}&Passwd={1}&source=davetheninja.net&service=analytics"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GoogleAccountQuery : IGoogleAccountQuery | |
{ | |
readonly string _email; | |
readonly string _password; | |
readonly string _applicationName; | |
public GoogleAccountQuery(string email, string password, string applicationName) | |
{ | |
_email = email; | |
_password = password; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.Mvc; | |
using Core.Web; | |
using Machine.Specifications; | |
namespace Core.Specs.Web | |
{ | |
[Subject(typeof(TempDataExtensions))] | |
public class when_setting_success_flash | |
{ | |
Establish context = () => |