This file contains 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
#region using | |
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using RestSharp; | |
#endregion | |
namespace TeamCitySharper |
This file contains 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
function Get-GitBranch { | |
$symbolicref = git symbolic-ref HEAD | |
$branch = $symbolicref.substring($symbolicref.LastIndexOf("/") +1) | |
return $branch | |
} | |
function Zip-GitBranch([string]$zipFilename) { | |
$branch = Get-GitBranch | |
This file contains 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
module.exports = (robot) -> | |
robot.router.post "/hubot/appharbor", (req, res) -> | |
robot.logger.info "Message received for appharbor" | |
builtApplicationName = req.body.application.name | |
buildStatus = req.body.build.status | |
robot.logger.info "AppHarbor build '#{buildStatus}' for application: '#{builtApplicationName}'" | |
user = robot.userForId 'broadcast' |
This file contains 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
var mouseDowns = Observable.FromEventPattern<MouseButtonEventHandler, MouseButtonEventArgs>(h => MouseDown += h, h => MouseDown -= h); | |
var mouseUps = Observable.FromEventPattern<MouseButtonEventHandler, MouseButtonEventArgs>(h => MouseUp += h, h => MouseUp -= h); | |
mouseDowns.Merge(mouseUps).WhenAny() .Subscribe(OneMouseUp); | |
} | |
private void OneMouseUp(EventPattern<MouseButtonEventArgs> eventPattern) | |
{ | |
var windowUnderCursor = NativeMethods.GetWindowUnderMouse(); |
This file contains 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
[Test] | |
public void BusinessUnit_SetToAValue_ExpectedPropertyChangedFired() | |
{ | |
//Arrange | |
//Act | |
//Assert | |
_viewModel.Should() | |
.FirePropertyChangedOn(s => s.BusinessUnit) | |
.When(s => s.BusinessUnit = "Test2"); |
This file contains 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
[Test] | |
public void ValueRangeType_SetToAValueWithOneValueRangeValueSelected_ExpectPropertyChangedFiredValueSetAndModelChangedMessageSent() | |
{ | |
//Arrange | |
var viewModel = makeValueRangeViewModel(); | |
var valueViewModel = viewModel.AddValue("value"); | |
valueViewModel.IsSelected = true; | |
//Act | |
//Assert |
This file contains 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
[Test] | |
public void Execute_ImportSuccessFulWithoutModifiedText_ExpectNoModelChangedMessageSent() | |
{ | |
//Arrange | |
var importCommand = makeImportAllTextsCommand(new ImportStatistics {ImportedCount = 0}); | |
var messageSent = false; | |
Messenger.Default.Register<ModelChangedMessage>(this, message => messageSent = true); | |
//Act |
This file contains 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
[Test, RequiresSTA] | |
public void DeleteBrickCommand_BrickSelected_ExpectEnableMainWindowMessageSentWithFalseThenTrue() | |
{ | |
//Arrange | |
var productViewModel = makeProductViewModel(); | |
var brick = productViewModel.AddBrick(); | |
var rootGraphSourceViewModel = new RootGraphSourceViewModel(); | |
rootGraphSourceViewModel.Initialize(productViewModel); | |
rootGraphSourceViewModel.Show(); |
This file contains 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
let setters = Types.WithFullName("NDepend.Attributes.CodeRuleAttribute").ChildMethods() | |
.Where(m => m.IsPropertySetter) | |
from m in Methods.UsingAny(setters) | |
select new { m, settersCalled = m.MethodsCalled.Intersect(setters) } |
This file contains 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 Router : NancyModule, IRouter | |
{ | |
public Router() | |
: base("/") | |
{ | |
Get["test"] = x => "hello"; | |
} | |
public void HttpGet(string path, Func<dynamic, dynamic> action) | |
{ | |
Get[path] = x => action; |
OlderNewer