ServiceReferenceMapFileName AddMapFileNameForServiceName(string serviceReferencesFolder, string serviceName)
        {
            var fileName = new ServiceReferenceMapFileName(serviceReferencesFolder, serviceName);

            SetServiceReferenceMapFileName(serviceName, fileName);
            return(fileName);
        }
Example #2
0
        public void GetServiceReferenceMapFileName_ProjectHasNoServiceReferences_ReturnsMapFileNameInServiceReferencesFolderWithSubFolderNamedAfterServiceReference()
        {
            CreateProject();
            SetProjectDirectory(@"d:\projects\MyProject");

            ServiceReferenceMapFileName fileName = project.GetServiceReferenceMapFileName("Service1");
            string expectedFileName = @"d:\projects\MyProject\Service References\Service1\Reference.svcmap";

            Assert.AreEqual(expectedFileName, fileName.Path);
        }
        public void AddServiceReference_GeneratesServiceReference_ReferenceServiceMapFileIsAddedToProject()
        {
            CreateGenerator();
            AddProxyFileNameForServiceName("MyServiceRef");
            ServiceReferenceMapFileName expectedMapFileName =
                AddMapFileNameForServiceName(@"d:\projects\MyProject\Service References", "MyServiceRef");

            generator.Options.ServiceName = "MyServiceRef";

            generator.AddServiceReference();

            SvcUtilRunCompletedSuccessfully();

            fakeProject.AssertWasCalled(p => p.AddServiceReferenceMapFile(expectedMapFileName));
        }
Example #4
0
        public void AddServiceReferenceMapFile_ProjectHasNoServiceReferences_ServiceReferenceMapAddedToProject()
        {
            CreateProjectWithMSBuildProject();

            var mapFileName = new ServiceReferenceMapFileName(@"d:\projects\MyProject\Service References", "Service1");

            project.AddServiceReferenceMapFile(mapFileName);

            string          fileName = @"d:\projects\MyProject\Service References\Service1\Reference.svcmap";
            FileProjectItem item     = GetFileFromMSBuildProject(fileName);

            string lastGenOutput = item.GetMetadata("LastGenOutput");
            string generator     = item.GetMetadata("Generator");

            Assert.AreEqual(ItemType.None, item.ItemType);
            Assert.AreEqual("Reference.cs", lastGenOutput);
            Assert.AreEqual("WCF Proxy Generator", generator);
        }
 void SetServiceReferenceMapFileName(string serviceName, ServiceReferenceMapFileName fileName)
 {
     fakeProject.Stub(p => p.GetServiceReferenceMapFileName(serviceName)).Return(fileName);
 }