Ejemplo n.º 1
0
        private Mongoose.Ews.Server.Data.EwsServer BootstrapEwsServer(string serverName)
        {
            var type          = typeof(CustomEwsServiceHost);
            var className     = type.FullName;
            var assembleyFile = $"{type.Assembly.GetName().Name}.dll";

            using (var adapter = EwsServerDataAdapter.ConnectNew(serverName, EwsEndpoint, "MyRealm", UserName, Password, true, true, assembleyFile, className))
            {
                adapter.PurgeData();

                // If you use the Adapter to access your service, you will get standard behavior.
                var vi = adapter.ValueItems.FirstOrDefault(x => x.AlternateId == ServerHelper.CityId);
                Assert.IsNull(vi);

                // Let's add the ValueItem our custom SetValuesProcessor is targeting
                var addedVi = adapter.AddValueItem(ServerHelper.CityId, "City", null, EwsValueTypeEnum.String, EwsValueWriteableEnum.Writeable, EwsValueForceableEnum.NotForceable, EwsValueStateEnum.Good, null);
                Assert.That(addedVi.Value, Is.Null.Or.Empty);

                // Add CityNameId
                addedVi = adapter.AddValueItem(ServerHelper.CityNameId, "City Name", null, EwsValueTypeEnum.String, EwsValueWriteableEnum.ReadOnly, EwsValueForceableEnum.NotForceable, EwsValueStateEnum.Good, null);
                Assert.That(addedVi.Value, Is.Null.Or.Empty);
                Assert.AreEqual(EwsValueStateEnum.Good, addedVi.State);

                // Even though we told the Server to auto start, it isn't running.  Why?  Because we're in a test harness even if SmartConnector is running in the background.
                Assert.IsFalse(adapter.Server.IsRunning);

                return(adapter.Server);
            }
        }
Ejemplo n.º 2
0
 protected override EwsServerDataAdapter CreateEwsServer()
 {
     return(EwsServerDataAdapter.ConnectNew(ServerName, EwsAddress, Realm, UserName, Password,
                                            true, true, "SmartConnector.WeatherExtension.dll", "SmartConnector.WeatherExtension.EwsServer.CustomEwsServiceHost"));
 }
 protected override EwsServerDataAdapter CreateEwsServer()
 {
     return(EwsServerDataAdapter.ConnectNew(ServerName, EwsAddress, "", UserName, Password,
                                            true, true, "Mongoose.Ews.Server.dll", "Mongoose.Ews.Server.MongooseEwsServiceHost"));
 }