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
SELECT | |
t.NAME AS TableName, | |
s.Name AS SchemaName, | |
p.rows AS RowCounts, | |
SUM(a.total_pages) * 8 AS TotalSpaceKB, | |
SUM(a.used_pages) * 8 AS UsedSpaceKB, | |
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB | |
FROM | |
sys.tables t | |
INNER JOIN |
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 static class UrlHelperExtensions | |
{ | |
public static string ContentWithHash(this UrlHelper urlHelper, string contentPath) | |
{ | |
var virtualFile = urlHelper.Content(contentPath); | |
var actualFile = urlHelper.RequestContext.HttpContext.Server.MapPath(contentPath); | |
var creationDateTime = (File.Exists(actualFile) ? File.GetLastWriteTimeUtc(actualFile) : new DateTime()).ToString("yyyyddMMHHmmss"); |
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 compareResult = new KellermanSoftware.CompareNetObjects.CompareLogic().Compare(actualResult, expectedResult); | |
Assert.IsTrue(compareResult.AreEqual, compareResult.DifferencesString); |
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 ActionResult Index(InputModel model) | |
{ | |
return Json(new | |
{ | |
total = 1234, | |
page = 1, | |
rows = new List | |
{ | |
new | |
{ |
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 SomeTest() | |
{ | |
var viewResult = this.controller.Index(new InputModelBuilder().Build()) as JsonResult; | |
viewResult.Should().NotBeNull(); | |
var data = viewResult.Data; | |
var pageNumber = data.GetType().GetProperty("page").GetValue(data, null); |
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
private object GetValue(object source, string propertyName) | |
{ | |
return source.GetType().GetProperty(propertyName).GetValue(source, null); | |
} |
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
this.GetValue(data, "page").Should().Be(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
var rows = (List<object><p> | |
)data.GetType().GetProperty("rows").GetValue(data, null); | |
rows.Count.Should().Be(1); | |
this.GetValue(rows[0], "id").Should().Be("98732312"); | |
var cell = rows[0].GetType().GetProperty("cell").GetValue(rows[0], null); | |
this.GetValue(cell, "prop1").Should().Be("a"); |
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
@echo off | |
echo Pre req checks... | |
echo|set /p=... Running as ADMIN ... | |
reg query "HKU\S-1-5-19" >nul 2>&1 | |
if %errorlevel% == 1 echo FAILED : Not runing as ADMIN | |
if %errorlevel% == 0 echo Passed | |
echo|set /p=... SQL Server ... | |
osql.exe -? >nul 2>&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
[Test] | |
public void ShouldReturnModelWithValuesSetCorrectly() | |
{ | |
var formCollection = new NameValueCollection | |
{ | |
{ "page", "5" }, | |
{ "rp", "8" }, | |
{ "query", "smith" }, | |
{ "sortname", "sname" }, | |
{ "sortorder", "sorder" } |
OlderNewer