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
//same class as before constructor and fields remain the same | |
[TestMethod] | |
public void When_Source_Is_Block_LastTwoRows_And_Target_The_Second_Row_Then_Drop_ShouldNot_Modify_Order() | |
{ | |
var dropInfo = new Mock<IDropInfo>(); | |
dropInfo.SetupGet(m => m.Data).Returns(new[] { _club3, _club4 }); | |
dropInfo.SetupGet(m => m.InsertIndex).Returns(2); | |
_championshipBetViewModel.Drop(dropInfo.Object); |
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
[TestMethod] | |
public void DragOver_With_A_Block_Source_Then_Effects_Should_Be_Set() | |
{ | |
var dropInfo = new Mock<IDropInfo>(); | |
dropInfo.SetupGet(m => m.Data).Returns(new[] { _club1, _club2 }); | |
dropInfo.SetupGet(m => m.InsertIndex).Returns(3); | |
_championshipBetViewModel.DragOver(dropInfo.Object); | |
dropInfo.VerifySet(x => x.DropTargetAdorner = It.IsAny<Type>(), Times.Once); |
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 ChampionshipBetViewModel : IChampionshipBetViewModel, IDropTarget | |
{ | |
//constructor, fields and command same as previous sample | |
public ObservableCollection<IFootballClub> FootballClubs { get; private set; } | |
public void DragOver(IDropInfo dropInfo) | |
{ | |
var selectedIndices = this.GetItemsBlock(dropInfo.Data).Select(c => FootballClubs.IndexOf(c)).ToList(); | |
//important: InsertIndex is the index of the item right AFTER the position we are inserting into |
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
/// <reference path="./app.js" /> | |
app.namespace("app.sut"); | |
app.sut = (function () { | |
"use strict"; | |
var sut = {}; | |
var factorial = function (n) { | |
if (n <= 1) return 1; |
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
/// <reference path="~/../WebApplication1/app/app.js" /> | |
/// <reference path="~/../WebApplication1/app/sut.js" /> | |
/// <reference path="~/lib/jasmine-2.0.0/jasmine.js" /> | |
/// <reference path="~/lib/jasmine-2.0.0/jasmine-html.js" /> | |
describe("sut Tests and factorial function", function () { | |
it("should return 1 with 0", function () { | |
expect(app.sut.factorial(0)).toBe(1); | |
}); |
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
$chutzpahPath = (Join-Path -Path $PSScriptRoot -ChildPath "Chutzpah.3.2.1\chutzpah.console.exe").ToString() | |
If(-not (Test-Path($chutzpahPath))) | |
{ | |
Write-Error "Cannot find chutzpath" | |
throw | |
} | |
$testPath = Join-Path -Path $PSScriptRoot -ChildPath "..\WebApplication1.Tests" |
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
using System.Reflection; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
[assembly: AssemblyTitle("armenAnalytics")] | |
[assembly: AssemblyDescription("")] | |
[assembly: AssemblyConfiguration("")] | |
[assembly: AssemblyCompany("")] | |
[assembly: AssemblyProduct("armenAnalytics")] | |
[assembly: AssemblyCopyright("Copyright © 2014")] |
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
Task PatchAssemblyInfo{ | |
function GetAssemblyVersion { | |
#skip the details for now -> returns the version major.minor (e.g. "6.7") | |
} | |
function GetAssemblyFileVersion { | |
#skip the details for now -> returns the long version major.minor.build (e.g. "6.7.35698") | |
} | |
function PatchFile ([string] $pattern, [string] $replaceString, [string] $fullPath){ |
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
#load all targets | |
Get-ChildItem (Join-Path $PSScriptRoot -ChildPath "./targets") | ForEach-Object{ & $_.FullName } | |
Task Example -Depends PatchAssemblyInfo, RenameMSI { | |
Write-Host "Example target executed" | |
} |
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 GetRevisionNumber { | |
$major = "1" | |
$minor = "0" | |
#we use the environment variable BUILD_NUMBER provided by teamcity, use -1 is not found to test locally the process | |
$patch= if ([string]::IsNullOrEmpty($env:BUILD_NUMBER)) { "-1" } else { $env:BUILD_NUMBER } | |
$major + "." + $minor + "." + $patch | |
} | |
function PatchFile ([string] $pattern, [string] $replaceString, [string] $fullPath){ |