public UploadSerializationTests()
        {
            textWriter = new Mock <TextWriter>();
            textWriter.Setup(tw => tw.Write(It.IsAny <string>())).Callback <string>(s => output += s);

            var urlGeneratorMock = new Mock <IUrlGenerator>();

            urlGeneratorMock.Setup(g => g.Generate(It.IsAny <RequestContext>(), It.IsAny <INavigatable>()))
            .Returns <RequestContext, INavigatable>(
                (context, navigatable) => navigatable.ControllerName + "/" + navigatable.ActionName
                );

            localizationServiceMock = new Mock <ILocalizationService>();
            localizationServiceMock.SetupGet(ls => ls.IsDefault).Returns(true);
            localizationServiceMock.Setup(l => l.All()).Returns(() =>
                                                                new Dictionary <string, string> {
                { "Remove", "Entfernen" }
            });

            upload      = UploadTestHelper.CreateUpload(urlGeneratorMock.Object, localizationServiceMock.Object);
            upload.Name = "Upload";
        }
示例#2
0
 public UploadBuilderTests()
 {
     upload  = UploadTestHelper.CreateUpload();
     builder = new UploadBuilder(upload);
 }