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
| Establish context = () => { | |
| var mocker = new AutoMoq.AutoMoqer(); | |
| mocker.GetMock<ISettingsRepository>() | |
| .Setup(x => x.GetCommon()) | |
| .Returns(new AssetsOptimizerSection { Compress = true }); | |
| handler = mocker.Resolve<AssetsHandler>(); | |
| var request = new Mock<HttpRequestBase>(); | |
| request.Setup(x => x.Headers) |
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
| [Subject(typeof(AssetsHandler))] | |
| public class When_compress_is_true_and_client_accepts_gzip : compression_spec | |
| { | |
| Establish context = () => { | |
| Compress = true; | |
| AcceptEncoding = "gzip"; | |
| }; | |
| Because of = () => handler.ProcessRequest(httpContext.Object); |
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 interface IFetchRequest<TQueried, TFetch> : IOrderedQueryable<TQueried> { } | |
| public class FetchRequest<TQueried, TFetch> : IFetchRequest<TQueried, TFetch> | |
| { | |
| public IEnumerator<TQueried> GetEnumerator() | |
| { | |
| return NhFetchRequest.GetEnumerator(); | |
| } | |
| System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() |
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
| IDependencyResolver resolver = Mock.Of<IDependencyResolver>(x => x.GetService(typeof(IDictionaryService)) == dictionaryService&& | |
| x.GetService(typeof(IDictionaryRepository)) == dictionaryRepository && | |
| x.GetService(typeof(IMappingEngine)) == mappingEngine); | |
| DependencyResolver.SetResolver(dependencyResolver); |
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 base_spec | |
| { | |
| protected static AutoMoqer mocker; | |
| protected static Mock<IDependencyResolver> resolver; | |
| private Establish context = () => | |
| { | |
| mocker = new AutoMoqer(); | |
| resolver = new Mock<IDependecyResolver> | |
| DependencyResolver.SetResolver(resolver.Object); |
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 Hoya.Administration.Web.UI.Controllers; | |
| using Machine.Specifications; | |
| namespace Hoya.Administration.Web.UI.Specs.SessionControllerSpecs | |
| { | |
| [Subject(typeof(SessionController))] | |
| public class SessionControllerSpec : BaseSpec | |
| { |
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
| $.validator.setDefaults({ | |
| highlight: function (element) { | |
| $(element).closest(".control-group").addClass("error"); | |
| }, | |
| unhighlight: function (element) { | |
| $(element).closest(".control-group").removeClass("error"); | |
| } | |
| }); | |
| $(function () { | |
| $('span.field-validation-valid, span.field-validation-error').each(function () { |
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
| builder.RegisterType<DenyAnonymousAccessPolicyViolationHandler>().As<IPolicyViolationHandler>(); | |
| Container = builder.Build(); | |
| var denyAnonymousAccessPolicyViolationHandler = DependencyResolver.Current.GetService<DenyAnonymousAccessPolicyViolationHandler>(); | |
| var denyAnonymousAccessPolicyViolationHandleri = DependencyResolver.Current.GetService<IPolicyViolationHandler>(); |
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; | |
| namespace Core.Utils | |
| { | |
| public static class SystemTime | |
| { | |
| public static Func<DateTime> Engine { private get; set; } | |
| static SystemTime() | |
| { |
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
| class Surface | |
| { | |
| public virtual void Draw(Shape shape) | |
| { | |
| shape.Draw(this); | |
| } | |
| } | |
| class EtchASketch : Surface | |
| { |